
深度学习
DanielFaster
这个作者很懒,什么都没留下…
展开
-
“Ninja is required to load C++ extensions”解决方案(Pychharm会 shell执行没这问题)
解决“Ninja is required to load C++ extensions“在shell窗口运行正常,但是在pycharm运行报错的问题原创 2024-12-13 12:42:17 · 391 阅读 · 0 评论 -
RuntimeError: CUDA error: no kernel image is available for execution on the device 解决
RuntimeError: CUDA error: no kernel image is available for execution on the device 解决原创 2024-12-12 20:58:41 · 380 阅读 · 0 评论 -
CUDNN_STATUS_NOT_SUPPORTED.This error may appear if you passed in a non-contiguous input(非调整批量大小)
目录环境说明问题描述解决方法探索1、(无效)调小batchSize2、(有效)换环境3、排查问题思路环境说明Ubuntu 18.04.5 LTSpython3.7pytorch 1.4.0问题描述跑一个新版本的实验过程中出现了这个问题,这个新版本是在旧版本基础上改进的,改动的都是一些模块的东西,并不涉及损失。报错具体内容如下Traceback (most recent call last): File "train_vit_v1_2...原创 2022-03-25 10:22:58 · 4179 阅读 · 1 评论 -
模型训练过程输出正常,跑验证集时某个分支输出效果很差(基于pytorch)
本文这是我宝贵的实战经验,看到的朋友请给我一打赞,非常感谢!!!问题说明最近我修改了一个模型,增加了一个分支。模型训练过程中各个分支输出正常,但是在跑验证集时某个分支输出效果很差,输出内容几乎是一副黑图,啥东西都没有。我做了网友给的两个解决办法,还是没能解决我的问题。一开始我很烦躁,因为之前在其他模型测试没有这个问题,代码也是差不多的,只是模型文件不同,所以没有什么思路。此时,我开启了网络寻答之路,网友们反馈的是1、可能是你数据没有归一化。但是我的数据已经归一化了。(最后发现是我的gt数原创 2020-10-09 20:03:52 · 1428 阅读 · 3 评论 -
图像通道转换[c h w] 转 [h w c]
cv2使用方法imread读出来图片的数据是[h w c] ,但是在pytorch中,我们往往使用的图片数据结构是[h w c],转换方法如下import numpy as npimport cv2img = cv2.imread(image_path)img = np.float32(cv2.resize(img, (320, 192))) / 255img = img.transpose(2, 0, 1)...原创 2020-08-13 15:08:29 · 9220 阅读 · 5 评论 -
加载模型出现 RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available()
今天在加载模型的时候出现了这个报错问题现象RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location='cpu' to map your storages to the CPU....原创 2020-08-11 20:52:34 · 12582 阅读 · 1 评论 -
加载模型出现 RuntimeError: Error(s) in loading state_dict for Model: Missing key(s) in state_dict
今天准备加载一个模型来测试的时候发现了一个问题,加载总是失败,报错是RuntimeError: Error(s) in loading state_dict for Model: Missing key(s) in state_dict"convd1.0.weight", "convd1.0.bias", "convd1.1.weight" 。咋一看,难道是因为我取值的问题,然后debug了一下,发现我的state_dict是符合要求的,但是为什么出现加载不了?问题代码 model = ..原创 2020-08-11 20:47:03 · 80066 阅读 · 97 评论 -
RuntimeError: CUDA out of memory 的解决
今晚在跑代码的时候出现这个问题,但是查看了一下GPU,命名内存是够的,后面发现虽然自己看到的内存是够的,但是真实的原因的确是因为内存不够导致,最后我调低了batchSize 问题就解决了!Traceback (most recent call last): File "train_SCRN.py", line 84, in <module> pred_sal, pred_edge = model(images) File "/home/ihavc/anaconda3...原创 2020-06-02 00:34:25 · 9335 阅读 · 0 评论