Skip to content
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

torch.cat不支持吗?unexpected keyword argument 'dim' #22

Open
wangshankun opened this issue May 20, 2019 · 14 comments
Open

torch.cat不支持吗?unexpected keyword argument 'dim' #22

wangshankun opened this issue May 20, 2019 · 14 comments

Comments

@wangshankun
Copy link

File "/home/shankun.shankunwan/CenterNet/src/lib/models/networks/DCNv2/dcn_v2.py", line 173, in forward
offset = torch.cat((o1, o2), dim=1)
File "/home/shankun.shankunwan/PytorchToCaffe/pytorch_to_caffe.py", line 534, in call
out=self.obj(self.raw,*args,**kwargs)
TypeError: _cat() got an unexpected keyword argument 'dim'

@JayLSU
Copy link

JayLSU commented May 24, 2019

File "/home/shankun.shankunwan/CenterNet/src/lib/models/networks/DCNv2/dcn_v2.py", line 173, in forward
offset = torch.cat((o1, o2), dim=1)
File "/home/shankun.shankunwan/PytorchToCaffe/pytorch_to_caffe.py", line 534, in call
out=self.obj(self.raw,*args,**kwargs)
TypeError: _cat() got an unexpected keyword argument 'dim'

Change dim to dimension or just delete "dim=" will be fine

@OPPOA113
Copy link

@wangshankun
hi 你那边CenterNet模型转caffe能跑通吗

@cwjhx
Copy link

cwjhx commented May 31, 2019

@wangshankun
hi 你那边CenterNet模型转caffe能跑通吗

我这边CenterNet去掉DCN模型转caffe可以转成功,但caffe转coreml时反卷积出错

@OPPOA113
Copy link

@cwjhx @wangshankun hi
你是直接去掉DCN还是讲DCN换成普通的conv?
我这边是换成普通的conv之后训练的模型,在转成caffe 的时候是在base.level3.project.1的下一个batchnormal那出现错误,也没有提示什么错误,就中断了。。。
你那边是什么个情况呢?有没有修改什么的了。。。?方便加个qq:542854954 交流吗

@wangshankun
Copy link
Author

@cwjhx @wangshankun hi
你是直接去掉DCN还是讲DCN换成普通的conv?
我这边是换成普通的conv之后训练的模型,在转成caffe 的时候是在base.level3.project.1的下一个batchnormal那出现错误,也没有提示什么错误,就中断了。。。
你那边是什么个情况呢?有没有修改什么的了。。。?方便加个qq:542854954 交流吗

放弃caffe了,我转onnx,用tensorrt执行

@cwjhx
Copy link

cwjhx commented Jun 3, 2019

@cwjhx @wangshankun hi
你是直接去掉DCN还是讲DCN换成普通的conv?
我这边是换成普通的conv之后训练的模型,在转成caffe 的时候是在base.level3.project.1的下一个batchnormal那出现错误,也没有提示什么错误,就中断了。。。
你那边是什么个情况呢?有没有修改什么的了。。。?方便加个qq:542854954 交流吗

放弃caffe了,我转onnx,用tensorrt执行

我这边转ONNX还是出现RuntimeError: Only tuples, lists and Variables supported as JIT inputs, but got dict.
请问这个问题你那边是怎么解决的?
谢谢

@wangshankun
Copy link
Author

@cwjhx @wangshankun hi
你是直接去掉DCN还是讲DCN换成普通的conv?
我这边是换成普通的conv之后训练的模型,在转成caffe 的时候是在base.level3.project.1的下一个batchnormal那出现错误,也没有提示什么错误,就中断了。。。
你那边是什么个情况呢?有没有修改什么的了。。。?方便加个qq:542854954 交流吗

放弃caffe了,我转onnx,用tensorrt执行

我这边转ONNX还是出现RuntimeError: Only tuples, lists and Variables supported as JIT inputs, but got dict.
请问这个问题你那边是怎么解决的?
谢谢

好像在centernet的问题下回答了
xingyizhou/CenterNet#77

@soham24
Copy link

soham24 commented Jun 22, 2019

@JayLSU should I change all dims in pytorch_to_caffe file to dimentions?

@happyday-lkj
Copy link

@JayLSU should I change all dims in pytorch_to_caffe file to dimentions?

just change the function _cat(raw, inputs, dimemsion) to _cat(raw, inputs, dim)

@sditeng
Copy link

sditeng commented Apr 3, 2020

改tools/pytorch_to_caffe.py文件中_cat
image

@zyc4me
Copy link

zyc4me commented Apr 10, 2020

改tools/pytorch_to_caffe.py文件中_cat
image

改了之后会出现这个key error是为什么呢

conv = torch.cat((conv, feat_mid), dim=1)

File "./pytorch_to_caffe.py", line 594, in call
out=self.obj(self.raw,*args,**kwargs)
File "./pytorch_to_caffe.py", line 237, in _cat
bottom_blobs.append(log.blobs(input))
File "./pytorch_to_caffe.py", line 88, in blobs
print("{}:{} getting".format(var, self._blobs[var]))
File "./pytorch_to_caffe.py", line 31, in getitem
return self.data[key]
KeyError: 140365443954224

@zyc4me
Copy link

zyc4me commented Apr 11, 2020

改tools/pytorch_to_caffe.py文件中_cat
image

改了之后会出现这个key error是为什么呢

conv = torch.cat((conv, feat_mid), dim=1)

File "./pytorch_to_caffe.py", line 594, in call
out=self.obj(self.raw,*args,**kwargs)
File "./pytorch_to_caffe.py", line 237, in _cat
bottom_blobs.append(log.blobs(input))
File "./pytorch_to_caffe.py", line 88, in blobs
print("{}:{} getting".format(var, self._blobs[var]))
File "./pytorch_to_caffe.py", line 31, in getitem
return self.data[key]
KeyError: 140365443954224

解决拉,是cat前一层的问题。。

@Liuzhenfa
Copy link

改tools/pytorch_to_caffe.py文件中_cat
image

改了之后会出现这个key error是为什么呢

conv = torch.cat((conv, feat_mid), dim=1)

File "./pytorch_to_caffe.py", line 594, in call
out=self.obj(self.raw,*args,**kwargs)
File "./pytorch_to_caffe.py", line 237, in _cat
bottom_blobs.append(log.blobs(input))
File "./pytorch_to_caffe.py", line 88, in blobs
print("{}:{} getting".format(var, self._blobs[var]))
File "./pytorch_to_caffe.py", line 31, in getitem
return self.data[key]
KeyError: 140365443954224

解决拉,是cat前一层的问题。。

请问你是怎么解决的,我也碰到同样的问题

@kaaier
Copy link

kaaier commented Nov 11, 2020

您好,我转这层的时候修改了参数的问题,可还是转不过去是什么原因?非常期待您的帮助

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants