vadimkantorov / caffemodel2pytorch

Convert Caffe models to PyTorch
389 stars 84 forks source link

downloaded caffe.proto cannot be read, saying FileNotFoundError, win10, python3 #8

Open asa008 opened 5 years ago

asa008 commented 5 years ago

Traceback (most recent call last):
File "caffe2PytorchTry001.py", line 7, in caffe_proto = 'https://raw.githubuserco File "F:\Projects\VesselSupportClassify2\ self.net_param = initialize(caffe_proto File "F:\Projects\VesselSupportClassify2\ subprocess.check_call(['protoc', '--pro File "C:\Users\q\AppData\Local\Program retcode = call(*popenargs, *kwargs)
File "C:\Users\q\AppData\Local\Program with Popen(
popenargs, **kwargs) as p: File "C:\Users\q\AppData\Local\Program restore_signals, start_new_session)
File "C:\Users\q\AppData\Local\Program startupinfo)
FileNotFoundError: [WinError 2] system cannot find out this file while the file do exists in temp file, but cannot be read

not work on win10, python 3

can you help me to solved this problem?

vadimkantorov commented 5 years ago

The initialize method has codegen_dir argument that could help you solve the issue. If you're using the CLI interface, feel free to change this line: https://github.com/vadimkantorov/caffemodel2pytorch/blob/master/caffemodel2pytorch.py#L386 and provide a codegen dir.

YeRen123455 commented 4 years ago

@asa008 Do you solve the problem?

vadimkantorov commented 4 years ago

Maybe it's some file path issue. Please print out the arguments before the protoc call, this will help you to debug the problem

honestabelink commented 4 years ago

For me, pip install protobuf did not add protoc to my path.

@asa008, @YeRen123455 Verify your system can find protoc, by calling it in your command window.

protoc --help

If it's not found, then append your PATH variable, you can run this for ease of testing

SET "PATH=%PATH%;path-to-protoc.exe"

protoc if running conda is found as a Hard Link in 2 locations, but I'd recommend the one in your active ENV.

%userprofile%\Anaconda2\envs\ENV_NAME\Lib\site-packages\torch\bin

So in theory, run this first and you should be good.

Update {ENV_NAME} to your conda env SET "PATH=%PATH%;%userprofile%\Anaconda2\envs\{ENV_NAME}\Lib\site-packages\torch\bin"

Adolf-K commented 3 years ago

Maybe it's some file path issue. Please print out the arguments before the protoc call, this will help you to debug the problem

Although I added my local path in line 386, I still prompted that the file could not be found and printed local caffe Proto, it's right. What should I do,thanks this is my code: self.net_param = initialize(caffe_proto, codegen_dir='E:\HRFAE-master').NetParameter()

vadimkantorov commented 3 years ago

Sorry, I'm not working on this project anymore. Your best bet is adding print commands and debugging it yourself