Comments (6)
output has three branch 3*66, so you should edit the code in pytorch2caffe
convert_layer(output_var[0].grad_fn)
convert_layer(output_var[1].grad_fn)
convert_layer(output_var[2].grad_fn)
as tuple object has no attribute 'grad_fn'
from pytorch2caffe.
have you finish?I meet the same problem
from pytorch2caffe.
@dzyjjpy @zhaobaozi @longcw Any updates on this ?
from pytorch2caffe.
@dzyjjpy @zhaobaozi I did what you advised but got stuck with this error.
File "pytorch2caffe.py", line 428, in <module>
os.path.join(output_dir, 'hopenet-pytorch2caffe.caffemodel'))
File "pytorch2caffe.py", line 38, in pytorch2caffe
net_info = pytorch2prototxt(input_var, output_var)
File "pytorch2caffe.py", line 330, in pytorch2prototxt
add_layer(output_var[0].grad_fn)
File "pytorch2caffe.py", line 157, in add_layer
top_name = add_layer(u[0])
File "pytorch2caffe.py", line 169, in add_layer
layer['type'] = layer_dict[parent_type]
KeyError: 'ExpandBackward'
I am a newbie, hope you can understand. Can you share the converted caffe model if possible ?
from pytorch2caffe.
@dzyjjpy I have solved all the previous errors and stuck with this one:
converting AddmmBackward190
((66L,), (66L, 2048L))
(66,)
(66, 8192)
Traceback (most recent call last):
File "pytorch2caffe.py", line 441, in <module>
os.path.join(output_dir, 'hopenet-pytorch2caffe.caffemodel'))
File "pytorch2caffe.py", line 99, in pytorch2caffe
convert_layer(output_var[0].grad_fn)
File "pytorch2caffe.py", line 94, in convert_layer
save_fc2caffe(weights, biases, params[parent_name])
File "pytorch2caffe.py", line 118, in save_fc2caffe
fc_param[0].data[...] = weights.numpy()
ValueError: could not broadcast input array from shape (66,2048) into shape (66,8192)
Please if you know how to convert any advice will be helpful.
from pytorch2caffe.
shape issue, pay attention to your tensor size. there might be issue caused by pooling layer's calculation mode. floor or ceil. pls check the layer with errors carefully
from pytorch2caffe.
Related Issues (20)
- 'Dot' object is not iterable HOT 3
- got error: Segmentation fault (core dumped) HOT 1
- pytorch 0.4 support
- ResNet size issue -> not accepting 224
- Does one model with nn.MaxUnpool2d layers in pytorch can be transformed to caffe model?
- CudnnBatchNormBackward
- KeyError: 'MkldnnConvolutionBackward' HOT 9
- which version of pytorch and torchvision should be used? advice needed HOT 5
- pytorch2caffe doesn't work for the last two layyers's convertion HOT 5
- ExpandBackward HOT 3
- layer_dict的对应关系
- "dot" not found in path HOT 2
- undefined symbol: _ZN3MPI8Datatype4FreeEv HOT 2
- training error
- 关于pytorch2caffe的步骤
- convert KeyError: 'MkldnnConvolutionBackward' HOT 1
- "TypeError: argument 0 is not a Variable", torch version:0.2.0
- Can it transform LSTM layer? HOT 1
- how do i transform pth file to caffemodel? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch2caffe.