Giter Site home page Giter Site logo

Comments (7)

vadimkantorov avatar vadimkantorov commented on June 10, 2024 1

@abhisheksambyal Please send a PR, I'll merge these

from caffemodel2pytorch.

vadimkantorov avatar vadimkantorov commented on June 10, 2024

It seems that either codegen_dir or caffe_proto are None. Could you please put in a print(codegen_dir, caffe_proto) before the local_caffe_proto = ... line and paste in here what it prints?

from caffemodel2pytorch.

NazarovAV avatar NazarovAV commented on June 10, 2024

Yes, caffe_proto was None.
I've added flag "caffe_proto = 'https://raw.githubusercontent.com/BVLC/caffe/master/src/caffe/proto/caffe.proto'" and fixed a couple of mistakes "AttributeError: 'OSError' object has no attribute 'message'" and "UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa2 in position 31: invalid start byte".
Now i get the message:
"Skipping layer [concat, Concat, Concat]: not found in caffemodel2pytorch.modules dict
Skipping layer [neg, Power, Power]: not found in caffemodel2pytorch.modules dict
Skipping layer [flatten, Flatten, Flatten]: not found in caffemodel2pytorch.modules dict
Skipping layer [abssum, Reduction, Reduction]: not found in caffemodel2pytorch.modules dict
caffemodel2pytorch: loading model from [tracker.caffemodel] in HDF5 format failed [], falling back to caffemodel format
caffemodel2pytorch: loaded model from [tracker.caffemodel] in caffemodel format
Traceback (most recent call last):
File "py.py", line 13, in
blobs_out = net.forward(data = np.zeros((8, 3, 224, 224), dtype = np.float32))
File "/media/veracrypt1/work/examples/trackers/caffemodel2pytorch-master/caffemodel2pytorch.py", line 119, in forward
assert name in variables, 'Variable [{}] does not exist. Pass it as a keyword argument or provide a layer which produces it.'.format(name)
AssertionError: Variable [target] does not exist. Pass it as a keyword argument or provide a layer which produces it."

from caffemodel2pytorch.

vadimkantorov avatar vadimkantorov commented on June 10, 2024

AssertionError: Variable [target] does not exist. Pass it as a keyword argument or provide a layer which produces it." basically this is it. It seems that your model wants to compute some loss with ground truth "target" - either you should write some code that would modify the network prior to forward pass or you should provide it with some (dummy?) target variables

from caffemodel2pytorch.

vadimkantorov avatar vadimkantorov commented on June 10, 2024

You should also decide if you want to provide pytorch equivalents of these modules:

"Skipping layer [concat, Concat, Concat]: not found in caffemodel2pytorch.modules dict
Skipping layer [neg, Power, Power]: not found in caffemodel2pytorch.modules dict
Skipping layer [flatten, Flatten, Flatten]: not found in caffemodel2pytorch.modules dict
Skipping layer [abssum, Reduction, Reduction]: not found in caffemodel2pytorch.modules dict

from caffemodel2pytorch.

vadimkantorov avatar vadimkantorov commented on June 10, 2024

If you do, please don't hesitate to send a PR - the codebase would improve from some porting to Python3 and more modern PyTorch

from caffemodel2pytorch.

abhisheksambyal avatar abhisheksambyal commented on June 10, 2024
  1. Line #139: Comment or remove e.message
  2. Line #140: Change to bytes_weights = open(weights, 'rb').read()

These two change worked for me.
Env: Pytorch: 1.5, Python: 3.6.9, Google Colab

from caffemodel2pytorch.

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.