Open Gotta-C opened 6 years ago
thx a lot and I will try.
I have modify the Cross-compiler to x86_64 and compiled,tested your model and got some errors. Error parsing text-format caffe.NetParameter: 2622:20: Message type "caffe.LayerParameter" has no field named "upsample_param". i guess have to define yolov3 layers in caffe,is there any caffe project including yolov3 layers?
@Gotta-C You should add upsample layer into caffe.Check this link.
I have tried your model and worked ! But still some errors in darknet2caffe(cfgfile, weightfile, protofile, caffemodel)
Traceback (most recent call last):
File "darknet2caffe.py", line 429, in
except darknet2caffe.py ,do other files need to be modified ?
It worked on yolov3.cfg,yolov3.weight now. My dataset only one class,still have the problem.
@Gotta-C You need change the classes value in my projects,which is 80.
I used grep checked,only detect.py has classes 80,not that problem.In training,i have modify all the filters to 18,because 1 class,and the weights is only 505k,compared to yolov3.weights is 248M,I have no idea whether its a problem.
where the error happens,weights convert to caffemodel or others?
weight to caffemodel .May I have your Q number or wechat?
I have tried your python code which could transform yolov3 model to caffemodel. But there are some errors: ''' unknow layer type yolo [libprotobuf ERROR google/protobuf/text_format.cc:274] Error parsing text-format caffe.NetParameter: 2622:20: Message type "caffe.LayerParameter" has no field named "upsample_param". WARNING: Logging before InitGoogleLogging() is written to STDERR F0626 10:08:24.390600 9704 upgrade_proto.cpp:90] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: yolov3.prototxt ''' could help me solve this problem? thanks a lot
How did you slove the yolo layer [yolo] in yolov3.cfg? thanks
@vvmex For unsample layer ,you should add it into caffe and i post the link in the previous content.For yolo layer,I have rewrite it in my projetcs.
Hi,Chen! It`s really exciting to find your project after spending so much time searching for something useful about yolov3-caffe and I really appreciate that you have implemented this and release your work to pubilc!
However,after trying out your code ,I have some errors which are the same with the other two guys when converting my darknet model and cfg file to caffemodel and prototxt : \ unknow layer type yolo [libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 2622:20: Message type "caffe.LayerParameter" has no field named "upsample_param". \ I have read the link you post and add unsample layer into caffe and change caffe.proto as the author pointed ,after compiling caffe I still have this error.I can see my cfg file has been converted to prototxt and compare to your prototxt provided,they are the same except "output" and "numclasses",so cfg file is ok,which means the problem is on converting model.
@zbw4034 Can you post the detail of error?
my error is this:
[libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 2622:20: Message type "caffe.LayerParameter" has no field named "upsample_param". WARNING: Logging before InitGoogleLogging() is written to STDERR F0627 20:21:10.194875 18559 upgrade_proto.cpp:79] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: cfg/yolov3.prototxt Check failure stack trace: Aborted (core dumped)
and i have followed your link which add upsample layer to caffe,and modified caffe.proto,then recompile caffe,but it still said can`t parse upsample_param
and in darknet2caffe.py,i just modified the python path of caffe. the order i type in in the terminal is just "python darknet2caffe.py cfg/yolov3-voc.cfg cfg/yolov3-voc_final.weights cfg/yolov3.prototxt cfg/yolov3.caffemodel" @ChenYingpeng
From error you said, i guess you didn't add upsample layer into caffe successfully,Go Baidu or Google it! Give you the link.Good luck!
FINALLY I SUCCEED ! After a whole day searching and trying,I succeed to finish converting.The main reason I failed is that I have install 3 versions of caffe(ssd,R-fcn,standard caffe-master),which makes the environment complicated.And at last I change to another gpu and make it out.
Thank you all !!!
@zbw4034 is there a reason why one should convert weights on their own instead of using the weights provided in the README?
@aaronduino because we want to test our own caffemodel,which is different from the one provided.
@Gotta-C Hello, did you successfully convert the weights to caffemodel? My dataset also has 1 class, but I failed in converting weight.
The repo is excellent, I have run yolov3 model succefully and get right result with caffe-yolo. In other words, I suggest @ChenYingpeng add darknet2caffe.py in this repo, and revise the scripts format.
@ChenYingpeng hello , i hope that you are doing well , i followed your repository that regards conversion between pytorch,darknet and caffe. but i got this error :"[libprotobuf ERROR google/protobuf/text_format.cc:274] Error parsing text-format caffe.NetParameter: 2622:20: Message type "caffe.LayerParameter" has no field named "upsample_param". WARNING: Logging before InitGoogleLogging() is written to STDERR F0224 23:43:05.536036 7907 upgrade_proto.cpp:90] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: yolov3.prototxt Check failure stack trace: Aborted (core dumped) " even i created the upsample layer (by creating three files and editing caffe.proto ) . i am wondering why this error occurs since i created upsampling layer . any suggestion will be helpful. i would like that you help me to solve this problem . thanks to all.
@adouwitti Hi,please make sure that you have added upsample layer into caffe and remember make it.Look for link from above.Good luck for you!
thanks for response @ChenYingpeng . i have added the upsample layer . when i tried to compile it again by running "make all" and " make ". another error has occurred :"PROTOC src/caffe/proto/caffe.proto caffe.proto:425:47: Field number 148 has already been used in "caffe.LayerParameter" by field "clip_param". Makefile:648: recipe for target '.build_release/src/caffe/proto/caffe.pb.cc' failed make: *** [.build_release/src/caffe/proto/caffe.pb.cc] Error 1 " . i got this error when i tried to compile it . thanks in advance.
Please look this “Field number 148 has already been used in "caffe.LayerParameter" by field "clip_param"”.You should change this number 148,such as 149,150 etc and make it.Good luck!
yeah i change the id numbers 149 ,150 and it works nice. thanks @ChenYingpeng
@ChenYingpeng hi, I failed to use script transformation model.My datasets only one class
@ycdhqzhiai Hi, please post your cfg file and running details.
@ycdhqzhiai Hi, please post your cfg file and running details.
add your q number just now,but i don't know the answer,can you add my q number (657621579)? thx
@liubianting 我和你遇到一样的问题,解决了吗?
@gttiankai Please check these code in darknet2caffe.py. `
#Open the weights file
fp = open(weightfile, "rb")
#The first 4 values are header information
# 1. Major version number
# 2. Minor Version Number
# 3. Subversion number
# 4. IMages seen
header = np.fromfile(fp, dtype = np.int32, count = 5)
#fp = open(weightfile, 'rb')
#header = np.fromfile(fp, count=5, dtype=np.int32)
#header = np.ndarray(shape=(5,),dtype='int32',buffer=fp.read(20))
#print(header)
buf = np.fromfile(fp, dtype = np.float32)
#print(buf)
fp.close()`
You should check whether your weights format is the same with me.You should change this code. `
--header = np.fromfile(fp, dtype = np.int32, count = 5)
++header = np.fromfile(fp, dtype = np.int32, count = 4)`
Good luck!
This link includes yolov2 weights to caffemodel.If you want to convert yolov3 weights to caffemodel,you need change some code.The code is below. `
`