-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AssertionError: channel size mismatch #20
Comments
Hi, 这个应该是spconv 2.x 和 spconv 1.2.1之间的差异导致的,之前也有人在issue里提到 |
我根据Runsheng的这个commit修改过code base 但好像确实4没有问题 我再测试一下回复你 |
yifanlu0227
added a commit
to yifanlu0227/CoAlign
that referenced
this issue
Jul 11, 2024
Previously we have faulty input channel number for SECOND related models, but you can still run them with spconv 1.2.1 (because spconv 1.2.1 has no sanity check). The performance should degrade but it still looks reasonable. More discussion can be found in [Issue 20](yifanlu0227/HEAL#20). Since we do not provide SECOND related checkpoint in CoAlign's repo, this should not affect too much.
Hi, 我把所有SECOND相关的yaml的args['spconv']['num_features_in']都修正为4。现在spconv 1.2.1和spconv 2.x都可以运行。 Thanks for catching this! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AssertionError: channel size mismatch
Chinese
当我运行 Code1 部分提供的 Python 命令时, 出现了这样一个错误:
AssertionError: channel size mismatch
当我试图调试它时, 我发现它和
modules
部分中的heter_encoders.py
中的SECOND
类, 中的spconv_block
层有关. 这个类是VoxelBackBone8x
类的实例, 初始化时,input_channels
通过读取配置文件中的args['spconv']['num_features_in']
来获取. 我查看了一下 m3 阶段对应的通道数为 64.然而当我在
spare_backbone_3d
的 forward 函数中将即将输入conv_input
层的input_sp_tensor
变量打印出来时, 得到的确是torch.Size([168423, 4])
然而正如前面提到的,conv_input
期待的输入通道数是 64 而并非是 4.我不知道发生了什么, 我也仔细看了一下配置文件, 并没有发现什么错误. 我该怎么解决呢? (我已经发现了一个解决办法就是将配置文件中
model/m3/encoder_args/num_features_in
的值修改为 4, 虽然能正常跑起来, 但是我不确定这样做会不会影响训练的精度, 以及训练过程中会不会发生什么意外错误导致训练无法正常进行).English
When I ran the Python command provided in the Code1 section, I got an error like this:
AssertionError: channel size mismatch
When I tried to debug it, I found that it was related to the
spconv_block
layer in theSECOND
class inheter_encoders.py
in themodules
section. This class is an instance of theVoxelBackBone8x
class. When initialized,input_channels
is obtained by readingargs['spconv']['num_features_in']
in the configuration file. I checked that the number of channels corresponding to the m3 stage is 64.However, when I printed out the
input_sp_tensor
variable that will be input to theconv_input
layer in the forward function ofspare_backbone_3d
, I did gettorch.Size([168423, 4])
However, as mentioned earlier, the number of input channels expected byconv_input
is 64 and not 4.I don’t know what happened. I also looked at the configuration file carefully and didn’t find any errors. How can I solve it? (I have found a solution, which is to change the value of
model/m3/encoder_args/num_features_in
in the configuration file to 4. Although it can run normally, I am not sure whether this will affect the accuracy of training, and whether there will be any unexpected errors during training that will prevent the training from proceeding normally).Code
Code1
Figure
Figure 1 调试语句 (Debug statements)
Figure 2 调试信息输出 (Debug information output)
Figure 3 配置文件修改 (Configuration file modification)
The text was updated successfully, but these errors were encountered: