Giter VIP home page Giter VIP logo

Comments (6)

dzyjjpy avatar dzyjjpy commented on July 17, 2024 1

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.

zhaobaozi avatar zhaobaozi commented on July 17, 2024

have you finish?I meet the same problem

from pytorch2caffe.

trohit920 avatar trohit920 commented on July 17, 2024

@dzyjjpy @zhaobaozi @longcw Any updates on this ?

from pytorch2caffe.

trohit920 avatar trohit920 commented on July 17, 2024

@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.

trohit920 avatar trohit920 commented on July 17, 2024

@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.

dzyjjpy avatar dzyjjpy commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.