cuda() missing 1 required positional argument: 'self'的可能错误原因

版权声明:转载注明出处 https://blog.csdn.net/york1996/article/details/82585079

在使用pytroch的过程中出现上述错误的可能原因是 

类的名称后面没有加括号就使用了cuda()函数。

比如:

model=fcFistCNN.cuda()

应该写成:

model=fcFistCNN().cuda()

 这样看来类实例化()括号就相当于self了。

猜你喜欢

转载自blog.csdn.net/york1996/article/details/82585079