Yolo 9000:OSError: libdarknet.so: cannot open shared object file: No such file or directory

网友投稿 1031 2022-10-01

Yolo 9000:OSError: libdarknet.so: cannot open shared object file: No such file or directory

Yolo 9000:OSError: libdarknet.so: cannot open shared object file: No such file or directory

最近需要使用yolo 9000的预训练模型,我用的是python接口,我这里分享一下我使用预训练模型的经验。我用的模型的官网地址为Stupid python path shit.# Instead just add darknet.py to somewhere in your python path# OK actually that might not be a great idea, idk, work in progress# Use at your own risk. or don't, i don't careimport sys, ossys.path.append(os.path.join(os.getcwd(),'python/'))import darknet as dnnet = dn.load_net("cfg/yolo9000.cfg", "../yolo9000-weights/yolo9000.weights", 0)meta = dn.load_meta("cfg/combine9k.data")# r = dn.detect(net, meta, "data/dog.jpg")# print r# print(r[0][0])image_files = os.listdir(image_path)with open("image_objects.txt","w") as file: num=0 for image_file in image_files: file_path=os.path.join(image_base_path,image_file) predict = dn.detect(net, meta,file_path) file.write(image_file) for predict_object in predict:# print r# print(r[0][0])image_files = os.listdir(image_path)with open("image_objects.txt","w") as file: num=0 for image_file in image_files: file_path=os.path.join(image_base_path,image_file) predict = dn.detect(net, meta,file_path) file.write(image_file) for predict_object in predict: file.write(" "+predict_object[0]) file.write("\n") num+=1 if(num%100==0): print(num)

但是在运行detector.py的时候出现了如下的错误:

OSError: libdarknet.so: cannot open shared object file: No such file or directory

我使用的是gpu版本,最后发现只要在命令行输入:

export PATH=/usr/local/cuda-8.0/bin:$PATHexport LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH

就行了。如果要使用gpu版本进行预测,参照官网的教程就行了

参考文献

[1].Yolo 9000.https://github.com/philipperemy/yolo-9000

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:小程序二维码怎么转换成链接?(小程序二维码怎么转换成链接二维码)
下一篇:SpringCloud使用Feign实现动态路由操作
相关文章

 发表评论

暂时没有评论,来抢沙发吧~