M
Modular7mo ago
Sam.H.W

Unable to run the kmean blog example.

I am not able to build the example here with mojo 24.4.0: https://github.com/modularml/devrel-extras/tree/main/blogs/mojo-kmeans-from-python
GitHub
devrel-extras/blogs/mojo-kmeans-from-python at main · modularml/dev...
Contains supporting materials for developer relations blog posts, videos, and workshops - modularml/devrel-extras
2 Replies
PhoToN 旭輝
PhoToN 旭輝7mo ago
@Sam.H.W the main problems I see from the Error text file you have provided is importing problems. In the latest Mojo version, some of these math functions were moved around if I am not wrong. For example, 1) You should use SIMD.__div__ instead of math.div in above case. 2) slice.__len()__ has been removed in 24.4 and you have to calculate it explicitly instead.
PhoToN 旭輝
PhoToN 旭輝7mo ago
For all the changes, Please look at “Standard library changes” in the latest change log here, https://docs.modular.com/mojo/changelog Kmeans should work once you implement these changes.
Mojo🔥 changelog | Modular Docs
A history of significant Mojo changes.

Did you find this page helpful?