自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(130)
  • 收藏
  • 关注

原创 scp 上传文件 permission denied

现在是把本地文件上传到服务器上,遇到permission denied 的情况。然后去服务器上,找到这个目录/data1/ ,使用root权限 输入。如果 permission denied。这样,应该就可以上传了。

2024-01-27 13:10:20 194 1

原创 linux查找文件

linux查找文件。

2024-01-24 20:19:40 352

原创 latex 特殊符号

在这里插入图片描述仅供学习参考。

2023-04-12 10:59:56 150 1

原创 Load key “/home/devid/.ssh/id_rsa“: bad permissions vscode 链接不上服务器问题

一篇文章的链接 https://zhuanlan.zhihu.com/p/364189095。在本地windows系统中找到秘钥位置,然后,修改秘钥权限。主要操作就是,把其他没用的删掉,添加上自己的。利用秘钥登陆,秘钥已生成,但。

2023-03-29 16:12:03 672

原创 学习率过大

本人调试了一个程序,但换了个模块,学习率增大了几十万倍,很不理解,解决方式:把学习率调小

2023-03-28 14:59:15 126

原创 文件从服务器下载到本地

10.10.10.10是服务器地址,/media/data是绝对路径,

2023-03-21 21:42:47 69

原创 AttributeError: module ‘distutils‘ has no attribute ‘version‘

原地址 https://blog.csdn.net/qq_38563206/article/details/125883522。原因是setuptools包版本过高。

2023-03-17 20:42:42 156

原创 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 926

原创 torch.matmul()

torch.matmul()

2022-11-17 20:30:45 201

原创 ModuleNotFoundError: No module named ‘numba‘

ModuleNotFoundError: No module named ‘numba’pip install numba

2022-11-09 16:05:35 1058

原创 RuntimeError: 1only batches of spatial targets supported (3D tensors) but got targets of size: : [1]

这个原因主要是因为,有个tensor 是三维的,但实际上代码需要是二维的tensor (我的代码遇到的问题是这样,网上众说纷纭,但没看到我需要的答案)首先找到代码报错那行,然后,看看哪个是三维的,需要转换成二维。

2022-11-09 10:49:02 3808

原创 torch.nn.Conv3d()

3D 卷积

2022-11-01 19:19:45 431

原创 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 601

原创 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 1553 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 2535

原创 -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 4909

原创 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 11243 12

原创 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 10235 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 1982

原创 vscode调试的时候左下角没有选择虚拟环境的标志

vscode调试的时候左下角没有选择虚拟环境的标志那就加载一下 Pylance 和 Python

2021-09-28 16:37:17 3261 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 2649

原创 vscode could not establish connection to “***”

vscode一直连不上服务器,是 could not establish connection to “***”之前一直用这个服务器,可能记住了以前的账号,目前需要删掉以前的信息,除了在vscode上面的config文件删掉内容外,还是连不上,那么就去 本地找 .ssh 文件,直接搜就可以找到这个文件,然后把之前建的账号全部删掉,就可以了...

2021-09-17 16:42:29 486

原创 texstudio左侧栏调出来

texstudio左侧栏调出来搜了好久,没一篇博客符合、接着点击side panel或者是

2021-08-20 12:52:51 6742 2

原创 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 2886 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 272

原创 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 927

原创 取数组里面前两个最大值

取数组里面前两个最大值,然后,通过做一个比值,用于后面的操作 l = distance_cosine # distance_cosine,这是一个数组,我想取里面的前两个值,因为不想破坏原来的distance_cosine,做了个赋值操作 predicted_y = np.argsort(-distance_cosine) # 对 distance_cosine 的值由大到小排序,之后,得到对应的索引 max = predicted_

2021-08-17 12:36:08 593

原创 取出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 492

原创 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 261

原创 ‘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 2552

原创 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 1901 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 5278

原创 TypeError: ‘tuple‘ object is not callable

TypeError: ‘tuple’ object is not callable报了一堆错误,然后,也没定位好哪句错了,因为我只加了一行代码,就报这个错误,那么只从这一行下手就好,一直没看出来,今天在次翻阅下,一看,原来是这行代码多了一个逗号,也不知道有没有和我同样问题的,先记录下吧...

2021-08-09 17:16:04 401 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 6633 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 2906

原创 EOFError: marshal data too short

EOFError: marshal data too short报了一堆错误,删掉原代码的_pycache_这个文件夹就可以了

2021-07-25 11:17:10 1032

原创 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 3372

原创 安装tensorflow

pip3 install tensorflow-gpu

2021-06-25 21:02:00 62

原创 查看服务器上硬盘使用情况

查看服务器上硬盘使用情况df -h

2021-06-21 21:05:56 448

原创 RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is Fal

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.代码出错的原因是因为,我的GPU没有这个7,而我代码里这么写

2021-06-20 20:43:05 264

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除