Closed eliasdjup closed 1 year ago
The code from the example of MaxPooling2DLayer returns AttributeError. Same for /examples/cnn/cnn_max_pool.py
Using manim==0.17.2 and manim-ml==0.0.16.
manim==0.17.2
manim-ml==0.0.16
from manim import * from manim_ml.neural_network import NeuralNetwork, Convolutional2DLayer, MaxPooling2DLayer class BasicScene(ThreeDScene): def construct(self): nn = NeuralNetwork( [ Convolutional2DLayer(1, 8), Convolutional2DLayer(3, 6, 3), MaxPooling2DLayer( kernel_size=2, ), Convolutional2DLayer(5, 2, 2), ], layer_spacing=0.25, ) nn.move_to(ORIGIN) self.add(nn) forward_pass = nn.make_forward_pass_animation() self.wait(1) self.play(forward_pass)`
Stack trace:
convolutional_2d_to_convolutional_2d.py:309 in init │ │ │ │ 306 │ │ self.num_output_feature_maps = self.output_layer.num_feature_maps │ │ 307 │ │ self.cell_width = self.output_layer.cell_width │ │ 308 │ │ self.stride = self.output_layer.stride │ │ ❱ 309 │ │ self.padding = self.input_layer.padding │ │ 310 │ │ self.filter_opacity = filter_opacity │ │ 311 │ │ self.cell_width = cell_width │ │ 312 │ │ self.line_color = line_color
mobject.py:660 │ │ in getattr │ │ │ │ 657 │ │ │ return types.MethodType(setter, self) │ │ 658 │ │ │ │ 659 │ │ # Unhandled attribute, therefore error │ │ ❱ 660 │ │ raise AttributeError(f"{type(self).name} object has no attribute '{attr} │ │ 661 │ │ │ 662 │ @property │ │ 663 │ def width(self):
AttributeError: MaxPooling2DLayer object has no attribute 'padding'
Sorry about that. It should be fixed if you run pip install --upgrade manim_ml.
pip install --upgrade manim_ml
Thank you for the quick response and help!
The code from the example of MaxPooling2DLayer returns AttributeError. Same for /examples/cnn/cnn_max_pool.py
Using
manim==0.17.2
andmanim-ml==0.0.16
.Stack trace:
convolutional_2d_to_convolutional_2d.py:309 in init │ │ │ │ 306 │ │ self.num_output_feature_maps = self.output_layer.num_feature_maps │ │ 307 │ │ self.cell_width = self.output_layer.cell_width │ │ 308 │ │ self.stride = self.output_layer.stride │ │ ❱ 309 │ │ self.padding = self.input_layer.padding │ │ 310 │ │ self.filter_opacity = filter_opacity │ │ 311 │ │ self.cell_width = cell_width │ │ 312 │ │ self.line_color = line_color
mobject.py:660 │ │ in getattr │ │ │ │ 657 │ │ │ return types.MethodType(setter, self) │ │ 658 │ │ │ │ 659 │ │ # Unhandled attribute, therefore error │ │ ❱ 660 │ │ raise AttributeError(f"{type(self).name} object has no attribute '{attr} │ │ 661 │ │ │ 662 │ @property │ │ 663 │ def width(self):
AttributeError: MaxPooling2DLayer object has no attribute 'padding'