SCNN_Pytorch icon indicating copy to clipboard operation
SCNN_Pytorch copied to clipboard

您好 请教一些问题。非常感谢。

Open HejhGitHub opened this issue 4 years ago • 38 comments

请问 我用您提供的exp0_best.pth去测试单张图片报错了 size mismatch for fc.0.weight: copying a param with shape torch.Size([128, 2880]) from checkpoint, the shape in current model is torch.Size([128, 4500]).我该怎么办, 请指教

HejhGitHub avatar Dec 23 '20 13:12 HejhGitHub

It seems you are asking same question the third time. #54 #56 就像我之前所说,你需要吧config.json中的输入图片大小和你需要load模型对应的图片大小一样。具体参考exp0和exp10

harryhan618 avatar Dec 23 '20 15:12 harryhan618

谢谢您的耐心回答。

HejhGitHub avatar Dec 24 '20 02:12 HejhGitHub

您好 再来请教一个问题。我直接运行python test_tusimple.py --exp_dir ./experiments/exp0。 报错了File "D:\download_code\SCNN_Pytorch-master\dataset\Tusimple.py", line 53, in getitem img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) cv2.error: OpenCV(3.4.2) c:\projects\opencv-python\opencv\modules\imgproc\src\color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'cv::CvtHelper<struc t cv::Set<3,4,-1>,struct cv::Set<3,4,-1>,struct cv::Set<0,2,5>,2>::CvtHelper'。 是哪里出了问题?我查了是图片格式问题,不知道什么情况。

HejhGitHub avatar Dec 24 '20 03:12 HejhGitHub

你要不先看看读进来的image什么size的?

harryhan618 avatar Dec 24 '20 09:12 harryhan618

您好 再来请教您tusimple数据集里面有train_set.zip、test_set.zip。它们解压后都有0531和0601这两个文件夹需要合并吗?

HejhGitHub avatar Dec 29 '20 13:12 HejhGitHub

您好 打扰一下请教您。我运行python test_tusimple.py --exp_dir ./experiments/exp0。出现错误提示该怎么办 Traceback (most recent call last): File "test_tusimple.py", line 140, in os.path.join(Dataset_Path['Tusimple'], 'test_label.json')) File "D:\download_code\SCNN_Pytorch-master\utils\lane_evaluation\tusimple\lane.py", line 73, in bench_one_submit raise Exception('Some raw_file from your predictions do not exist in the test tasks.')

HejhGitHub avatar Dec 30 '20 01:12 HejhGitHub

0531和0601各自放在clips下边。 没有遇到过你第二个问题

harryhan618 avatar Dec 30 '20 02:12 harryhan618

非常谢谢您的回答,出现这么多问题,应该是我不清楚数据集解压后里面的文件具体该怎么放。

HejhGitHub avatar Dec 30 '20 02:12 HejhGitHub

您好 下载的tusimple数据集有train_set.zip、test_set.zip。他们两个解压后也分别有clips。 readme里面有提示Tusimple_path ├── clips ├── label_data_0313.json ├── label_data_0531.json ├── label_data_0601.json └── test_label.json 请问 readme里面的clips是需要把解压后的两个clips合并,还是只需要train_set里面的clips。

HejhGitHub avatar Dec 30 '20 03:12 HejhGitHub

你看readme里没有提到两个clip,就知道放一起啊。 而且你可以看代码,我是怎么读取图片的呀。 答案都在代码里,不要碰到问题就来问

harryhan618 avatar Dec 30 '20 06:12 harryhan618

好的,非常感谢您的解答

HejhGitHub avatar Dec 30 '20 08:12 HejhGitHub

再来打扰请教您。运行python test_tusimple.py --exp_dir ./experiments/exp0。 Traceback (most recent call last): File "test_tusimple.py", line 141, in os.path.join(Dataset_Path['Tusimple'], 'test_label.json')) File "D:\download_code\SCNN_Pytorch-master\utils\lane_evaluation\tusimple\lane.py", line 73, in bench_one_submit raise Exception('Some raw_file from your predictions do not exist in the test tasks.') Exception: Some raw_file from your predictions do not exist in the test tasks. 好多天了 实在不知道怎么办?能帮帮忙吗?是不是数据集里面图片不对。

HejhGitHub avatar Jan 04 '21 12:01 HejhGitHub

我没有遇到过这个错误。 这个错误说明你有预测的图片结果不在ground truth里面,你排除一下不就行了。或者看看ground truth是不是漏了什么

harryhan618 avatar Jan 05 '21 06:01 harryhan618

请问ground truth里面的test_label.json无效点为-2, 程序运行生成的predict_test.json里面变成-1这个有影响吗?

HejhGitHub avatar Jan 05 '21 08:01 HejhGitHub

下载的数据集文件我都没有改动一点,这个是网上分享的百度网盘下载,没有在您给的链接里面下载,是数据集出问题了吗?

HejhGitHub avatar Jan 05 '21 11:01 HejhGitHub

请问ground truth里面的test_label.json无效点为-2, 程序运行生成的predict_test.json里面变成-1这个有影响吗?

没有影响

下载的数据集文件我都没有改动一点,这个是网上分享的百度网盘下载,没有在您给的链接里面下载,是数据集出问题了吗?

你下的数据集,我怎么知道呀 [笑哭]

harryhan618 avatar Jan 05 '21 11:01 harryhan618

谢谢你了,这个问题终于解决了。以后还有问题望多多指教

HejhGitHub avatar Jan 08 '21 08:01 HejhGitHub

Good for you.

harryhan618 avatar Jan 08 '21 15:01 harryhan618

您好 运行test_CULane.py出现问题,可能是文件路径不对但是不知道怎么改,请指点一下 test.sh: 32: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 33: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 34: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 35: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 36: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 37: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 38: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 39: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 40: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 41: test.sh: cannot create /home/hjh/SCNN_Pytorch//experiments//coord_output//../evaluate/_iou0.5_split.txt: Directory nonexistent

HejhGitHub avatar Jan 18 '21 06:01 HejhGitHub

请问你编译了/home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane下面的文件了吗?

harryhan618 avatar Jan 18 '21 06:01 harryhan618

您好 我是先运行cd utils/lane_evaluation/CULane mkdir build && cd build cmake .. make 然后在cd 返回到SCNN目录运行python test_CULane.py --exp_dir ./experiments/exp10。出现的还是这个错误。是哪里出了问题

HejhGitHub avatar Jan 18 '21 12:01 HejhGitHub

我发现在/home/hjh/SCNN_Pytorch/utils/lane_evaluation/CULane/下的evaluate 文件打了个?,请问是这里出问题了吗

HejhGitHub avatar Jan 18 '21 13:01 HejhGitHub

抱歉我无法回答你的问题(以及之前的问题),因为:

  1. 你提供的信息都不太切实,我无法依此诊断问题在哪。
  2. 我没有义务从一加一教到你怎么学微积分。我觉得你缺乏基本的自我解决问题的能力。这个github repo只是一个初步的引领,我能保证我在readme里的教程很详细、每一步都能顺利运行。但接下来怎么适应你的编程环境,怎么应用到你自己的应用要求,那就自求多福了。

harryhan618 avatar Jan 19 '21 03:01 harryhan618

您好 运行test_CULane.py出现问题,可能是文件路径不对但是不知道怎么改,请指点一下 test.sh: 32: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 33: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 34: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 35: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 36: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 37: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 38: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 39: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 40: test.sh: /home/hjh/SCNN_Pytorch//utils/lane_evaluation/CULane/evaluate: not found test.sh: 41: test.sh: cannot create /home/hjh/SCNN_Pytorch//experiments//coord_output//../evaluate/_iou0.5_split.txt: Directory nonexistent

By the way, 你看看是不是因为路径中有两个斜杠的问题。

harryhan618 avatar Jan 19 '21 03:01 harryhan618

非常谢谢您的多次耐心解答,这个问题在您的提醒下解决了。刚刚进入这一领域,问题比较多,希望不要见怪。再次感谢。

HejhGitHub avatar Jan 19 '21 06:01 HejhGitHub

It's ok. 我只是觉得你基础还没打牢,更应该花时间钻研。你问的问题实在是太基础了,就是那种一碰到问题没有自己找解决方案就来的提问的感觉。越是新手越不能这样。

harryhan618 avatar Jan 19 '21 07:01 harryhan618

您好 我想用深度可分离卷积Separable Convolution去替换VGG里面的普通卷积,我自己定义了一个class SeparableConv2d(nn.Module):然后我模仿您的代码中process backbone流程去替换出现以下错误。 RuntimeError: Error(s) in loading state_dict for SeparableConv2d: Missing key(s) in state_dict: "conv1.weight", "pointwise.weight". Unexpected key(s) in state_dict: "weight", "bias". 请问这该往哪方面去考虑

HejhGitHub avatar Feb 02 '21 14:02 HejhGitHub

因为你定义的类本来就没有weight和bias啊。。。 [笑哭] 为什么不用conv的group来做dw卷积呢?

harryhan618 avatar Feb 02 '21 15:02 harryhan618

您好 看了很久还是不太明白,不知道怎么改了。深度可分离卷积由Depthwise(DW)卷积与Pointwise(PW)卷积组成的。我的代码是 class SeparableConv2d(nn.Module): def init(self,in_channels,out_channels,kernel_size=1,stride=1,padding=0,dilation=1,bias=False): super(SeparableConv2d,self).init() self.conv1 = nn.Conv2d(in_channels,in_channels,kernel_size,stride,padding,dilation,groups=in_channels,bias=bias) self.pointwise = nn.Conv2d(in_channels,out_channels,1,1,0,1,1,bias=bias) def forward(self,x): x = self.conv1(x) x = self.pointwise(x) return x 我感觉这已经用到了conv的group来做dw卷积呢。请在指点指点,谢谢您了。

HejhGitHub avatar Feb 09 '21 10:02 HejhGitHub

  1. 应该是这么定义的,forward里面没有relu之类的嘛?
  2. 你碰到的问题是啥?

harryhan618 avatar Feb 09 '21 14:02 harryhan618