helblazer811 / ManimML

ManimML is a project focused on providing animations and visualizations of common machine learning concepts with the Manim Community Library.
MIT License
2.35k stars 140 forks source link

filename change in layers #22

Closed aronvandepol closed 1 year ago

aronvandepol commented 1 year ago

after installing manim_ml on my anaconda env, i noticed that the import in the example from manim_ml.neural_network.layers.convolutional_2d import Convolutional2DLayer

didn't work. After digging into the site packages, and locating why the rest of the imports due work i found that it was because the file is called convolutional2d.py and not convolutional_2d.py making this import in the example not work. Seems the pip build has a different name for this file

I checked by reinstalling the latest build from pip on 26.01.2023.

helblazer811 commented 1 year ago

Thanks! Let me update fix this bug and then update the pip registry.

helblazer811 commented 1 year ago

I updated the pip registry. Can you let me know if it works now? Sorry if the project is a bit unstable right now. It is still under development.

helblazer811 commented 1 year ago

The image file that I reference in the example will likely have to be removed or replaced with a different image that you download as well. I may end up changing the readme example to be something that can just be copied and pasted as an example.

aronvandepol commented 1 year ago

Yeah, I noticed some variables referenced also didn't work. e.g self.play() references neural_network but its named nn in the example. Also no filter_heights where defined in the Convolutional2Dlayer() either causing my code to bug when rendering.

helblazer811 commented 1 year ago

Ah, you are right about the variable in the readme. Hmm. I think I refactored out filter_height in the updated pip package. Did you download that and it still doesn't work?

aronvandepol commented 1 year ago

Yeah, somehow this code snippet specifically bugged out on that part. But I managed to get it working without! Not sure what exactly is happening there.

helblazer811 commented 1 year ago

I made a new example that runs on my local installation. If running this does not work then it is probably something to do with the package versioning.

https://github.com/helblazer811/ManimML/blob/main/examples/readme_example/example.py

aronvandepol commented 1 year ago

I made a new example that runs on my local installation. If running this does not work then it is probably something to do with the package versioning.

https://github.com/helblazer811/ManimML/blob/main/examples/readme_example/example.py

Tried to run this, again verified I was running the latest version using pip install manim_ml. The code still errors saying:

TypeError: init() missing 1 required positional argument: 'filter_height'

So I guess the recent removal of that argument hasn't passed onto pip yet?

helblazer811 commented 1 year ago

When you run pip show manim-ml does it show version 0.0.12 or 0.0.13. The most recent version is 0.0.13. When I looked at the code in that package it has the most recent code (not including filter_height).

aronvandepol commented 1 year ago

0.0.12 indeed.

running pip install manim_ml outputs

Requirement already satisfied: manim_ml in /opt/anaconda3/lib/python3.9/site-packages (0.0.12)

helblazer811 commented 1 year ago

Try running pip install --upgrade manim_ml and see if that updates the package to 0.0.13

aronvandepol commented 1 year ago

That worked. Totally forgot to add --upgrade as an argument. My bad!

runs smoothly now :)

helblazer811 commented 1 year ago

No worries at all. Thanks so much for bearing with me! I will definitely have to be a bit more careful that I update the pip registry and test everything before I post on twitter about new changes haha.