![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
遇到的错误
譕訫_
自学ing.....
展开
-
记录一次安装pytorch遇到的问题---zipFile Badzipfile---ReadTimeoutError: HTTPSConnectionPool
时隔几个月,再次重回炼丹领域,还是啥也不会。。。不知道什么原因,原本的torch1.6.0+cu101(好像是101忘记了)出现了莫名其妙的问题,所有关于torch.nn下的函数和包全部报错,只好重装。查询本机的cuda版本. 登录pytorch官网,选择对应版本的torch进行安装,如笔者的版本是11.1,就安装对应的版本。pytorch官网因为使用的pip安装,所以直接复制下面的文本,在cmd中进行安装即可。在安装中出现了几个莫名其妙的错误,①zipFile Badzipfile,没找到具体的原创 2021-05-18 10:43:39 · 1207 阅读 · 1 评论 -
损失率下降,但是准确率却提升慢或准确率结果不高
问题原因:学习率设置太高,一个epoch直接收敛,所以损失不会下降。又没有设置防止过拟合的比如学利率一开始设置为1,因为下降太快,那么很有可能在一个epoch旧完全收敛。所以看到的validation数值并不下降,第一个epoch就已经处于谷底了。最常见的原因:过拟合。主要包括:数据量小,网络复杂,learning rate 比较高,又没有设置任何防止过拟合的机制解决方法:简化模型,且进行数据增强,如:翻转,平移,随机裁剪等利用 dropout层利用正则化normalization没有原创 2021-01-13 21:36:52 · 18272 阅读 · 0 评论 -
ValueError: List argument ‘indices‘ to ‘Sparse Concat‘ Op with length 0 shorter than minimum length2
错误ValueError: List argument ‘indices’ to ‘Sparse Concat’ Op with length 0 shorter than minimum length 2.在实现github代码的时候,由于keras版本的原因把keras.backend.image_dim_ordering()更改为keras.backend.image_data_format(),‘th’和’tf’更改为’channels_first’和’channels_last’。之后程序运行时原创 2020-11-02 12:52:54 · 1087 阅读 · 0 评论 -
错误TypeError: add_weight() got multiple values for argument ‘name‘
错误TypeError: add_weight() got multiple values for argument ‘name’在代码执行时报错TypeError: add_weight() got multiple values for argument ‘name’。经过查阅资料发现是在定义卷积模型的代码模块中的self.add_weight(shape, initializer=self.gamma_init, regularizer=self.gamma_regularizer原创 2020-11-01 13:38:33 · 4501 阅读 · 1 评论 -
错误AttributeError: module ‘keras.backend‘ has no attribute ‘image_dim_ordering‘
运行语句if K.image_dim_ordering() == ‘tf’: 出现错误AttributeError: module ‘keras.backend’ has no attribute ‘image_dim_ordering’原因是keras版本的原因,在新版本中把 image_dim_ordering更改为image_data_format,所以要使用K.image_data_format() == 'channel_last'K.image_data_format() == 'chan原创 2020-11-01 10:36:12 · 1048 阅读 · 0 评论 -
pytorch错误RuntimeError: CUDA error: device-side assert triggered
在调试模型时出现RuntimeError: CUDA error: device-side assert triggered的错误,经过查找资料,发现是我的label数据是1-37的,在把label数据调整为0-36后,不再报错.问题主要是标签数据要从0开始,否则就会报出RuntimeError: CUDA error: device-side assert triggered的错误...原创 2020-10-19 14:37:10 · 4176 阅读 · 6 评论 -
错误-torch.nn.modules.module.ModuleAttributeError:: ‘xxx’ object has no attribute ‘copy’
使用torch.load_state_dict()出现的问题 model_path='./文件夹/文件名.pth' model = SPPNet() model.load_state_dict(torch.load(model_path))报错torch.nn.modules.module.ModuleAttributeError: 'SPPNet' object has no attribute 'copy'经过查询资料发现问题出现在训练模型的代码中,在保存模型时,使用的是 tor原创 2020-10-16 13:25:48 · 7710 阅读 · 0 评论 -
错误AssertionError: size of input tensor and input format are different
在写代码的过程中出现了如下错误:AssertionError: size of input tensor and input format are different。根据查询资料发现是tensorboardX的版本问题。原本安装的是2.0版本,把2.0版本卸载,安装1.4版本即可解决该问题。cmd卸载指令:pip uninstall tensorboardX安装指令pip install tensorboardX==1.4...原创 2020-10-13 10:50:33 · 985 阅读 · 1 评论