- 博客(133)
- 收藏
- 关注
原创 Unexpected key(s) in state_dict: “iteration“, “model_state_dict“, “optimizer_state_dict“, “scheduler
加载预训练模型,出现问题。
2024-05-24 14:35:57
240
原创 gpustat 不能使用问题
突然间就不能用了,可能是环境出了问题,如果GPU没问题的话,那么换个环境重新安装试一下(pip install gpustat),目前是换个环境就可以了(做个笔记)
2024-05-10 19:01:28
406
原创 scp 上传文件 permission denied
现在是把本地文件上传到服务器上,遇到permission denied 的情况。然后去服务器上,找到这个目录/data1/ ,使用root权限 输入。如果 permission denied。这样,应该就可以上传了。
2024-01-27 13:10:20
978
1
原创 Load key “/home/devid/.ssh/id_rsa“: bad permissions vscode 链接不上服务器问题
一篇文章的链接 https://zhuanlan.zhihu.com/p/364189095。在本地windows系统中找到秘钥位置,然后,修改秘钥权限。主要操作就是,把其他没用的删掉,添加上自己的。利用秘钥登陆,秘钥已生成,但。
2023-03-29 16:12:03
1145
原创 AttributeError: module ‘distutils‘ has no attribute ‘version‘
原地址 https://blog.youkuaiyun.com/qq_38563206/article/details/125883522。原因是setuptools包版本过高。
2023-03-17 20:42:42
204
原创 Class acmart Error: No country present for an affiliation. \maketitle
Class acmart Error: No country present for an affiliation. \maketitle
2023-03-07 20:55:42
1339
原创 ModuleNotFoundError: No module named ‘numba‘
ModuleNotFoundError: No module named ‘numba’pip install numba
2022-11-09 16:05:35
1330
原创 RuntimeError: 1only batches of spatial targets supported (3D tensors) but got targets of size: : [1]
这个原因主要是因为,有个tensor 是三维的,但实际上代码需要是二维的tensor (我的代码遇到的问题是这样,网上众说纷纭,但没看到我需要的答案)首先找到代码报错那行,然后,看看哪个是三维的,需要转换成二维。
2022-11-09 10:49:02
4274
原创 RuntimeError: invalid argument 4: Index tensor must have same size as output tensor apart from the s
RuntimeError: invalid argument 4: Index tensor must have same size as output tensor apart from the specified dimension at /opt/conda/conda-bld/pytorch_1587428398394/work/aten/src/THC/generic/THCTensorScatterGather.cu:328坑,找了一圈,发现自己的代码是环境问题...
2022-04-29 20:33:48
678
原创 vscode调试出错 FileNotFoundError: [Errno 2] No such file or directory: ‘/media/data3/a/tools/train.py
FileNotFoundError: [Errno 2] No such file or directory: '/media/data3/a/tools/train.pyvscode调试出错,明明有这个路径,但报错,原因是因为launch.json里面路径多个空格类似于这种"program": "/media/data3/a/tools/train.py ", # 在.py 后面多了一个空格...
2022-02-15 10:34:10
1654
1
原创 RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn找到那个tensor,假设为x, 然后后面加上x = x.clone().detach().requires_grad_(True)或者x = torch.tensor(x,requires_grad=True)
2022-01-28 20:36:51
2626
原创 -bash: ./tools/dist_train.sh: Permission denied
-bash: ./tools/dist_train.sh: Permission denied只需要:chmod 777 ./tools/dist_train.sh
2021-12-12 16:27:18
5678
原创 RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling `cublasSgemm( handle, opa, opb, m
RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc)错误的原因是nn.Linear() 维度错了
2021-10-08 11:26:33
11695
13
原创 DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warnin
DeprecationWarning: np.float is a deprecated alias for the builtin float. To silence this warning, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.把错误那行代码里面的np
2021-10-07 11:01:49
10409
3
原创 vscode里面launch.json 写法,供参考
vscode里面launch.json 写法,供参考 (2021-09-30){ // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "随便自己起", "type": "python", "request": "l
2021-09-30 17:03:19
2133
原创 vscode调试的时候左下角没有选择虚拟环境的标志
vscode调试的时候左下角没有选择虚拟环境的标志那就加载一下 Pylance 和 Python
2021-09-28 16:37:17
3785
4
原创 RuntimeError: CUDA error: device kernel image is invalid
RuntimeError: CUDA error: device kernel image is invalid降低pythorch 版本conda install pytorch=1.2
2021-09-17 21:40:18
3855
原创 vscode could not establish connection to “***”
vscode一直连不上服务器,是 could not establish connection to “***”之前一直用这个服务器,可能记住了以前的账号,目前需要删掉以前的信息,除了在vscode上面的config文件删掉内容外,还是连不上,那么就去 本地找 .ssh 文件,直接搜就可以找到这个文件,然后把之前建的账号全部删掉,就可以了...
2021-09-17 16:42:29
570
原创 RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking arugment for argument mat1 in method wrapper_addmm)首先,找到报错的那行代码,然后,在后面加上**.cuda()**例如test_class_word_embedding = data[‘test_class
2021-08-19 01:31:18
3245
1
原创 把list和str进行合并
aim_class_names 是一个list:里面有[‘giving_or_receiving_award’, ‘reading_book’, ‘hopscotch’, ‘breakdancing’, 'massaging_b’]aim_query_name 是一个str,里面有 ['massaging_b’]#分别赋值给a,b,不想破坏原有的a = {}b = {}a = aim_class_namesb = aim_query_nameb1 = b.split() # 把 str变成l
2021-08-18 17:47:41
319
原创 TypeError: can‘t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to
TypeError: can’t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.a1 = a1.data.cpu().numpy()
2021-08-17 13:21:29
990
原创 取数组里面前两个最大值
取数组里面前两个最大值,然后,通过做一个比值,用于后面的操作 l = distance_cosine # distance_cosine,这是一个数组,我想取里面的前两个值,因为不想破坏原来的distance_cosine,做了个赋值操作 predicted_y = np.argsort(-distance_cosine) # 对 distance_cosine 的值由大到小排序,之后,得到对应的索引 max = predicted_
2021-08-17 12:36:08
719
原创 取出array里面的第几个数
比如说L= [3,2,4,8]取出array里面的第1个数num_1 = L[:,0]那么num_1 是 3取出array里面的第2个数num_1 = L[:,1]那么num_1 是 2
2021-08-17 12:14:16
578
原创 not enough values to unpack (expected 2, got 1)
not enough values to unpack (expected 2, got 1)啊一个小问题,我搞了好久,当时以为其他地方出问题,万万没想到啊predicted_y,loss = self.myClassifier.predict(data_result,a1)调用这个函数其实出来就一个值,算了。。。我一直以为是data_result 格式不对。。。无语==...
2021-08-17 03:07:28
303
原创 ‘numpy.ndarray‘ object has no attribute ‘append‘
’numpy.ndarray’ object has no attribute 'append’头上加个fusion_fea = []在后面的for循环中:加入 fusion_fea.append(fusion_fea_0)
2021-08-16 22:09:26
2670
原创 can‘t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory
can’t convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first改写成这种形式 fusion_fea_0 = fusion_fea_0.data.cpu().numpy()
2021-08-16 22:07:19
1988
1
原创 RuntimeError: Function MmBackward returned an invalid gradient at index 0 - got [5, 2048] but expect
RuntimeError: Function MmBackward returned an invalid gradient at index 0 - got [5, 2048] but expected shape compatible with [5, 4096]这个问题是在定义的时候出错比如代码self.fc = nn.Linear(2048, 2048) 这是错误的改成 self.fc = nn.Linear(4096, 2048)...
2021-08-12 01:45:43
5579
原创 TypeError: ‘tuple‘ object is not callable
TypeError: ‘tuple’ object is not callable报了一堆错误,然后,也没定位好哪句错了,因为我只加了一行代码,就报这个错误,那么只从这一行下手就好,一直没看出来,今天在次翻阅下,一看,原来是这行代码多了一个逗号,也不知道有没有和我同样问题的,先记录下吧...
2021-08-09 17:16:04
472
1
原创 AttributeError: module ‘torch.nn‘ has no attribute ‘GELU‘
AttributeError: module ‘torch.nn’ has no attribute 'GELU’升级pytorch版本去pytorch官网找那行代码源代码 是 self.af1 = nn.GELU() #original 变成 **self.af1 = nn.ReLU(inplace=True)** #me
2021-07-30 11:09:23
6869
4
原创 RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking arugment for argument mat1 in method wrapper_addmm)说至少有两个设备,cup 和 cuda 0其实就加了一个MLP,然后想测一下,结果就报这个错误方法是:self.mlp1 = MLP(2048)在这个
2021-07-25 17:07:37
3026
1
原创 EOFError: marshal data too short
EOFError: marshal data too short报了一堆错误,删掉原代码的_pycache_这个文件夹就可以了
2021-07-25 11:17:10
1222
原创 RuntimeError: batch1 dim 2 must match batch2 dim 1
RuntimeError: batch1 dim 2 must match batch2 dim 1这个问题就是两个特征的维度要匹配比如,这个代码A = torch.bmm(exemplar_corr, query_flat)exemplar_corr 特征大小为[96, 49, 1024])query_flat 特征大小为 [96, 2048, 49]那这样的话,就会报上面的错误,1024 和2048 无法相乘...
2021-07-22 16:51:59
3690
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人