Pytorch问题总结

Pytorch问题总结,第1张

1.使用多线程时报错:

将程序加入到

if __name__ == "__main__" 中

Pytorch使用多线程加载数据报错_Restart丶的博客-CSDN博客_pytorch多线程加载数据

2.使用jupyter时,报错:内核挂掉了,需要重启

 解决:加入以下代码

 结果:

 jupyter notebook内核挂掉了,需要重启_取个名字真难呐的博客-CSDN博客_挂掉的内核

3.导入torchvision时,报错:python无法找到入口,无法定位程序输入点

问题:torch版本和torchvision版本不对应,需要查看版本,卸载后重新下载

 https://github.com/pytorch/vision#installation

4.使用graphviz查看网络结构图时报错:

ExecutableNotFound: failed to execute [‘dot’, ‘-Tsvg’], make sure the Graphviz executables are on your systems

不仅要在conda中下载graphviz,还需要去官网下载一个软件并且配置到环境变量中

注意:先安装软件再用conda下载graphviz,不然一定报错

安装graphviz和python -graphviz

解决failed to execute [‘dot’, ‘-Tsvg’], make sure the Graphviz executables are on your systems_坤斤拷的博客-CSDN博客

5.NotImplementedError报错:

问题:定义前向传播的函数 forward()出问题,检查:

①函数名拼写对不对

②函数格式有没有对齐,或者对齐错误 

 

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/800480.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-07
下一篇2022-05-07

发表评论

登录后才能评论

评论列表(0条)

    保存