caffemodel2pytorch icon indicating copy to clipboard operation
caffemodel2pytorch copied to clipboard

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

Open asa008 opened this issue 5 years ago • 6 comments

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?

asa008 avatar Apr 12 '19 08:04 asa008

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.

vadimkantorov avatar Jun 11 '19 05:06 vadimkantorov

@asa008 Do you solve the problem?

YeRen123455 avatar Apr 23 '20 09:04 YeRen123455

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

vadimkantorov avatar Apr 23 '20 10:04 vadimkantorov

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"

honestabelink avatar Jun 30 '20 22:06 honestabelink

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()

Adolf-K avatar Oct 13 '21 08:10 Adolf-K

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

vadimkantorov avatar Oct 13 '21 09:10 vadimkantorov