完全按照老师的代码敲,出现AttributeError: 'Net' object has no attribute 'conv1'
试了改过各种变量名,一直有这个报错,有人知道为什么吗?
Traceback (most recent call last):
File "E:/PythonProject/venv/Study1/2_1_test.py", line 60, in <module>
out = net(input_data)
File "E:\WorkTools\Anaconda\envs\renzhe\lib\site-packages\torch\nn\modules\module.py", line 532, in __call__
result = self.forward(*input, **kwargs)
File "E:/PythonProject/venv/Study1/2_1_test.py", line 29, in forward
x = self.conv1(x)
File "E:\WorkTools\Anaconda\envs\renzhe\lib\site-packages\torch\nn\modules\module.py", line 576, in __getattr__
type(self).__name__, name))
AttributeError: 'Net' object has no attribute 'conv1'
Process finished with exit code 1