
debug
captain飞虎大队
飞虎大队
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
cuDNN error: CUDNN_STATUS_INTERNAL_ERROR
仅作为记录,大佬请跳过。修改分类的数量,即可。原创 2023-04-25 22:32:36 · 248 阅读 · 0 评论 -
[git] You may want to first integrate the remote changes hint: (e.g., ‘git pull ..
仅作为记录。转载 2022-08-04 21:51:15 · 4058 阅读 · 0 评论 -
TypeError: iteration over a 0-d array
仅作为记录,大佬请跳过。原因:metric_value不是torch([2,2])这种多值张量,而是单值的np.array(0.2)——所以不能用list(metric_value)原创 2022-05-11 22:31:23 · 4909 阅读 · 0 评论 -
使用model.load_state_dict()时,出现AttributeError: ‘str‘ object has no attribute ‘copy‘
仅作为记录,大佬请跳过。括号里面要带上torch.loadmodel.load_state_dict(torch.load('/output/model_state_dict.pth'))即可。参考原创 2022-04-22 15:16:27 · 4252 阅读 · 1 评论 -
RuntimeError: cuda runtime error (710) : device-side assert triggered at /py
仅作为记录,大佬请跳过。文章目录背景解决参考背景博主在运行训练网络的程序时,出现RuntimeError: cuda runtime error (710) : device-side assert triggered at /py解决分类的类别数设置错误修改后,即可。参考感谢大佬博主文章:传送门...转载 2022-03-28 20:12:45 · 2698 阅读 · 0 评论 -
[mathtype]Please restart Word to load MathType addin properly——文件未找到: MathPage.WLL
仅作为记录,大佬请跳过。文章目录背景解决参考背景word打开后,显示对话框Please restart Word to load MathType addin properly,点击mathtype标题栏时,显示对话框文件未找到: MathPage.WLL解决将MathPage.wll复制到STARTUP文件夹外面,即可。(博主的MathPage.wll在C:\Program Files (x86)\MathType\MathPage\64)(将MathPage.wll复制到C:\Prog转载 2022-03-25 10:56:10 · 724 阅读 · 0 评论 -
[swin-trans]分布式训练的debug:ValueError: Error initializing torch.distributed using env:// rendezvous: en
仅作为记录,大佬请跳过。在用torch.distributed.init_process_group(backend='nccl', init_method='env://', world_size=world_size, rank=rank)时,出现文章目录1、ValueError: Error initializing torch.distributed using env:// rendezvous: environment variable MASTER_ADDR expected, but n转载 2022-03-24 10:30:23 · 22167 阅读 · 0 评论 -
Default process group has not been initialized, please make sure to call ini
仅作为记录,大佬请跳过。将distributed的值改为False,即可。参考传送门原创 2022-03-22 11:43:00 · 7225 阅读 · 0 评论 -
Installation did not succeed. The application could not be installed: INSTALL_FAILED_ABORTED Install
仅作为记录,大佬请跳过。背景博主在用实体手机调试时,run的时候出现:解决调试用的手机锁屏了,需要打开手机点击确认安装,即可。原创 2022-02-17 17:47:18 · 700 阅读 · 0 评论 -
No implementation found for java.lang.String android.os.SystemProperties.native_get(java.lang.String
仅作为记录,大佬请跳过。博主用老手机华为mate2,实体调试时,出现Installation failed due to: ''pm install-create -r -t -S 14459522' returns error 'Unknown failure: java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String android.os.SystemProperties.native_get(java.l原创 2022-02-17 13:57:23 · 1085 阅读 · 0 评论 -
ERROR: Module ‘OpenCVLib452‘: platform ‘android-28‘ not found.
仅作为记录,大佬请跳过。文章目录问题解决参考问题出现ERROR: Module 'OpenCVLib452': platform 'android-28' not found.解决在android studio里的sdk manager中下载API Level为28的Android SDK参考感谢大佬博主文章:传送门...转载 2022-02-17 00:09:21 · 332 阅读 · 0 评论 -
Installed Build Tools revision 32.0.0 is corrupted. Remove and install again using the SDK Manager.
仅作为记录,大佬请跳过。文章目录背景解决参考背景博主重装android studio 3.6,在关闭杀毒软件的情况下,仍出现:Installed Build Tools revision 32.0.0 is corrupted。 Remove and install again using the SDK Manager.解决即改名。将android_sdk中的build-tools的32.0.0文件夹和build-tools的32.0.0的lib文件夹参考感谢大佬博主文章:传送门转载 2022-02-16 23:58:55 · 5506 阅读 · 16 评论 -
pycharm调试时,控制台输入出现the view is read-only和pause the process to use the command line
仅作为记录,大佬请跳过。文章目录the view is read-onlypause the process to use the command linethe view is read-only点击切换几次就好了pause the process to use the command line点击Show Python Prompt(控制台左侧的python图标的地方)参考感谢大佬博主文章:传送门...原创 2022-02-13 20:59:30 · 6963 阅读 · 0 评论 -
pycharm远程服务器连接后调试时,出现trying to add breakpoint to file that does not exist: /data_sda/d:/segmentation
仅作为记录,大佬请跳过。出现trying to add breakpoint to file that does not exist: /data_sda/code/lcode/d:/segmentation/a1.py (will have no effect)解决用pycharm的open,将pycharm的文件路径,打开到所运行文件的位置即可。即所运行的文件是m.py,但pycharm打开的文件夹路径不是m.py文件所在的路径(修改成m.py所在的路径)...原创 2022-02-13 19:32:01 · 1170 阅读 · 0 评论 -
pandas.errors.ParserError: Error tokenizing data. C error: 的解决【实测成功】
仅作为记录,大佬请跳过。用,error_bad_lines=False背景博主在运行df = pd.read_csv('label.csv', encoding="utf-8")时,出现:pandas.errors.ParserError: Error tokenizing data. C error: Expected 3 fields in line 9, saw 19解决将代码改为:df = pd.read_csv('label.csv', encoding="utf-8",error_转载 2022-01-09 10:20:10 · 20978 阅读 · 0 评论 -
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xce in position 0: inva——csv文件
仅作为记录,大佬请跳过。背景博主用pd.read_csv打开csv文件时,出现:解决加上encoding="gbk"即可import pandas as pddf=pd.read_csv('label.csv',encoding="gbk")df.drop([row_num])原创 2022-01-06 15:50:01 · 976 阅读 · 0 评论 -
PermissionError: [Errno 13] Permission denied: ‘label.csv‘
仅作为记录,大佬请跳过。博主在用python写入.csv文件时,出现PermissionError: [Errno 13] Permission denied: 'label.csv'解决关闭打开的csv文件,即可。原创 2022-01-06 14:17:05 · 1032 阅读 · 0 评论 -
使用pytorch的loss.backward()时,出现element 0 of tensors does not require grad and does not have a grad_fn
仅作为记录,大佬请跳过。用loss.requires_grad_(True)是因为loss没有设置梯度(所以不能反向传播)(loss的数据类型是tensor)设置梯度后即可,展示:原创 2021-09-06 09:49:10 · 6099 阅读 · 1 评论 -
torch的tensor,在用loss = criterion(outputs,label),dimension specified as 0 but tensor has no dimensions
仅作为记录,大佬请跳过。torch.tensor([])里面加上中括号,即可。展示参考传送门原创 2021-09-05 21:25:18 · 1797 阅读 · 0 评论 -
博主用nn.softmax时出错“softmax_lastdim_kernel_impl“ not implemented for ‘Long‘
仅作为记录,大佬请跳过。要进行softmax的tensor里面的元素是float解决将int改为float即可:参考感谢大佬博主文章:传送门tensor的nn.softmax示例import torchimport torch.nn as nn_a=torch.tensor([float(1),float(1),float(0)])m=nn.Softmax(dim=0)_a_nnsoftmax=m(_a)print(_a,'\n',_a_nnsoftmax)...原创 2021-09-03 21:16:50 · 3198 阅读 · 0 评论 -
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for i
仅作为记录,大佬请跳过。博主在做类激活图时,(result已经将原图像np.array和heatmap的np.array相加),但是在plt.imshow(result)时,出现:Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).解决加上/255即可。参考感谢大佬博主文章传送门...原创 2021-09-03 11:28:06 · 892 阅读 · 0 评论 -
‘module‘ object is not callable
仅作为记录,大佬请跳过。定义函数的名称与使用函数时的名称不一致rnn_forwardrun_forward修改后即可原创 2021-09-03 06:16:39 · 179 阅读 · 0 评论 -
module ‘tensorflow‘ has no attribute ‘placeholder‘,和在不pip修改成旧版本tensorflow的情况下-使用旧版本tensorflow
仅作为记录,大佬请跳过。文章目录module 'tensorflow' has no attribute 'placeholder'在不pip修改成旧版本tensorflow的情况下-使用旧版本tensorflow参考module ‘tensorflow’ has no attribute ‘placeholder’其中module 'tensorflow' has no attribute 'placeholder'是因为tensorflow版本高,应该换用旧版本tensorflow(1.几)在不原创 2021-08-28 22:58:09 · 216 阅读 · 0 评论 -
too many values to unpack (expected 2)
仅作为记录,大佬请跳过。函数返回值的个数出错博主是定义函数时,最后的return写少了:参考感谢大佬博主文章:传送门原创 2021-08-28 14:41:15 · 149 阅读 · 0 评论 -
IEDA没有出现运行箭头的解决
仅作为记录,大佬请跳过。博主忘记添加static,加上即可。展示原创 2021-08-23 15:55:41 · 420 阅读 · 0 评论 -
java: 需要<标识符>的解决
仅作为记录,大佬请跳过。博主在使用读取文件的程序的try-catch时,出现java: 需要<标识符>的解决解决展示原创 2021-08-23 15:14:29 · 6849 阅读 · 0 评论 -
weight of size [64, 3, 7, 7], expected input[1, 4, 512, 1024] to have 3 channels, but got 4 channels
仅作为记录,大佬请跳过。在博主文章之后,博主又打开一张新的图片,在喂入模型后-又出现这个问题:weight of size [64, 3, 7, 7], expected input[1, 4, 512, 1024] to have 3 channels, but got 4 channels instead即原本三通道的图片,经过读取后变成了四通道。解决加入.convert('RGB'),是Image.open函数造成的即可。感谢大佬博主文章:传送门...原创 2021-08-03 08:22:18 · 1769 阅读 · 0 评论 -
Expected 4-dimensional input for 4-dimensional weight, but got 3-dimensional input of size [3, 512,
仅作为记录,大佬请跳过。博主将手动读取的一张图块,用transforms转化成tensor(3, 512, 1024)后,喂入模型出现Expected 4-dimensional input for 4-dimensional weight [64, 3, 7, 7], but got 3-dimensional input of size [3, 512, 1024] instead原因喂入模型的tensor应该是四维:(3, 512, 1024)——(1, 3, 512, 1024)解决原创 2021-08-03 08:12:48 · 5876 阅读 · 1 评论 -
TypeError: expected string or buffer,用Image.fromarray(roi).save时出现
仅作为记录,大佬请跳过。直接用roi.save即可。(因为此时的roi不是numpy.array,而是Image数据类型)原创 2021-08-02 08:44:20 · 373 阅读 · 0 评论 -
cv2.findContours中not enough values to unpack (expected 3, got 2)
仅作为记录,大佬请跳过。将img_contour, contours, hierarchy = cv2.findContours(img_bin, cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)改为:contours, hierarchy = cv2.findContours(img_bin, cv2.RETR_EXTERNAL,cv2.CHAIN_APPROX_SIMPLE)传送门...转载 2021-07-31 17:38:23 · 325 阅读 · 0 评论 -
unzip解压缩linux文件时出现error [Testing.zip]: start of central directory not found;zipfile corrupt——7z
仅作为记录,大佬请跳过。经过师兄的指点,这个bug是因为unzip无法解压缩大于4G的文件。文章目录解决解决用7za x Training.zip参考感谢大佬博主文章:传送门原创 2021-07-30 23:24:17 · 10772 阅读 · 0 评论 -
Invalid shape (3, 1024, 2048) for image data
仅作为记录,大佬请跳过。用.T即 (3, 1024, 2048)不能plt,而应该是(某,某,3)才能显示。参考原创 2021-07-25 21:31:52 · 5227 阅读 · 0 评论 -
pycharm中couldn‘t upload helpers for remote
仅作为记录,大佬请跳过。用pycharm连接远程运行程序时,无法运行,说连接不上服务器,出现couldn't upload helpers for remote……的短暂提示。解决博主等了15分钟,再次运行,即可。原创 2021-07-20 08:21:14 · 1868 阅读 · 0 评论 -
cannot register a hook on a tensor that doesn‘t require gradient的解决
仅作为记录,大佬请跳过。博主在explan-tran时,新建该模型(用训练集训练和测试集测试),在用测试集测试时,出现cannot register a hook on a tensor that doesn't require gradient的问题。经pychram调试看参数,发现是在原模型设计时,有保存梯度的步骤;而博主的程序在测试是,不用梯度,因此出现模型的保存错误做法将原模型中保存梯度的代码注释掉,即可。展示就可以连续运行了:...原创 2021-07-19 08:42:59 · 3457 阅读 · 2 评论 -
linux中no modules named “labelme“
仅作为记录,大佬请跳过。用pip install labelme即可安装。原创 2021-07-10 22:05:36 · 768 阅读 · 0 评论 -
PIL.Image转tensor和name ‘transforms‘ is not defined的解决
仅作为记录,大佬请跳过。出现name 'transforms' is not defined的解决:import torchvisiontransform = torchvision.transforms.Compose([torchvision.transforms.ToTensor()]) 即可。PIL.Image转tensorfrom PIL import Imageimport torchvisionimg = Image.open('/Data4T/samples/her2_原创 2021-07-09 13:43:47 · 6828 阅读 · 2 评论 -
python批量赋值和tensor转numpy
仅作为记录,大佬请跳过。是a,b,c,d=0,0,0,0tensor转numpy(需先将tensor弄到cpu):preds=preds.cpu().numpy()原创 2021-07-06 11:40:26 · 320 阅读 · 0 评论 -
关于torchvision的加载没有标签的数据:RuntimeError: Found 0 files in subfolders of:
仅作为记录,大佬请跳过。torchvision加载数据,必须将数据放到train或者val文件夹下且数据结构是:train/标签1或val/标签1如train/0;train/cat因此,在实际测试,不知道标签的情况下,让网络预测数据标签解决:放到val文件夹下,将tiles放到val/sdpc_tiles_1:然后加载。...原创 2021-07-06 11:23:28 · 371 阅读 · 0 评论 -
RuntimeError: CUDA error: CUBLAS_STATUS_ALLOC_FAILED when calling `cublasCre
仅作为记录,大佬请跳过。出现原因:是模型的分类数不匹配博主要进行四分类,但resnet18在这一行的代码(将最后一层全连接)设置成了三分类,因此error。将3改为4,即可解决。原创 2021-07-06 08:33:00 · 8182 阅读 · 2 评论 -
python读取json标注文件时,出现UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x90 in position 128: ille
仅作为记录,大佬请跳过。出现UnicodeDecodeError: 'gbk' codec can't decode byte 0x90 in position 128: ille解决:文件名不能含有中文字符【】原创 2021-07-04 22:49:51 · 1027 阅读 · 0 评论