Comments (7)
@abhisheksambyal Please send a PR, I'll merge these
from caffemodel2pytorch.
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.
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.
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.
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.
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.
- Line #139: Comment or remove e.message
- 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)
- How to use converted-model (pt)?? HOT 1
- What mean of Skipping Layer?? HOT 1
- pytorch2caffemodel HOT 1
- google.protobuf.text_format.ParseError: 52:3 : Message type "caffe.LayerParameter" has no field named "bn_param". HOT 3
- caffe to pytorch model HOT 2
- FileNotFoundError: [Errno 2] No such file or directory: 'protoc': 'protoc' HOT 1
- Run Caffe models using PyTorch as backend HOT 1
- Add support for older caffe model HOT 3
- urllib.error.URLError: <urlopen error [Errno 104] Connection reset by peer> HOT 2
- how do i install it HOT 1
- Error in converting model with Fast RCNN HOT 1
- docker image
- 3D support and Deconvolution HOT 1
- Attribute error HOT 1
- FileNotFoundError: [WinError 2] HOT 1
- URL reading doensn't work in Python 3 HOT 10
- exception had an invalid syntax HOT 2
- downloaded caffe.proto cannot be read, saying FileNotFoundError, win10, python3 HOT 6
- AttributeError: module 'google.protobuf.descriptor' has no attribute '_message' HOT 5
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 caffemodel2pytorch.