TypeError: 'builtin_function_or_method' object is not subscriptable...
发布网友
发布时间:2024-10-04 22:00
我来回答
共1个回答
热心网友
时间:2024-10-21 13:29
python程序报错
Traceback (most recent call last):
File "main.py", line 152, in <module>
train(epoch)
File "main.py", line 120, in train
100. * batch_idx / len(train_loader), loss.item[0]))
TypeError: 'builtin_function_or_method' object is not subscriptable
解决方法:
将item[0]改为item(0)
热心网友
时间:2024-10-21 13:31
python程序报错
Traceback (most recent call last):
File "main.py", line 152, in <module>
train(epoch)
File "main.py", line 120, in train
100. * batch_idx / len(train_loader), loss.item[0]))
TypeError: 'builtin_function_or_method' object is not subscriptable
解决方法:
将item[0]改为item(0)