算能科技
直播中

qjqb

8年用户 1278经验值
擅长:5762
私信 关注
[问答]

yolov5模型转换报错怎么解决?

使用自己训练的模型进行转换报错,错误如下:
root@docker-desktop:/workspace/yolov5-hat# python3 -m bmnetp --model=weights/best.pt --net_name=yolov5s --target=BM1684 --outdir=compilation --shapes="[1,3,640,640]"
Namespace(cmp=True, desc=None, descs=None, dyn=None, enable_profile=False, input_structure=None, list_ops=False, log_dir='', log_prefix=True, mode='compile', model='weights/best.pt', net_name='yolov5s', opt=1, outdir='compilation', output_names=None, seed=42, shapes=[[1, 3, 640, 640]], target='BM1684', v=3)
python3 -m bmnetp --model=weights/best.pt --net_name=yolov5s --target=BM1684 --outdir=compilation --shapes="[1,3,640,640]" --opt=1 --cmp=true --dyn=false --enable_profile=false --mode=compile --seed=42
/root/.local/lib/python3.7/site-packages/bmnetp/bin/bmnetp.bin --model=weights/best.pt --net_name=yolov5s --target=BM1684 --outdir=compilation --shapes="[1,3,640,640]" --opt=1 --cmp=true --dyn=false --enable_profile=false --mode=0 --seed=42
terminate called after throwing an instance of 'c10::Error'
  what():  [enforce fail at inline_container.cc:222] . file not found: archive/constants.pkl
frame #0: c10::ThrowEnforceNotMet(char const*, int, char const*, std::string const , void const*) + 0x47 (0x7f73dc5500e7 in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libc10.so)
frame #1: caffe2::serialize::PyTorchStreamReader::getRecordID(std::string const ) + 0xed (0x7f73ccdc2ccd in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libtorch_cpu.so)
frame #2: caffe2::serialize::PyTorchStreamReader::getRecord(std::string const ) + 0x21 (0x7f73ccdc2d41 in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libtorch_cpu.so)
frame #3: torch::jit::readArchiveAndTensors(std::string const , c10::optional >, c10::optional > (c10::StrongTypePtr, c10::IValue)> >, c10::optional, caffe2::serialize::PyTorchStreamReader ) + 0x62 (0x7f73ce2ba2f2 in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libtorch_cpu.so)
frame #4:  + 0x348b8b4 (0x7f73ce2ba8b4 in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libtorch_cpu.so)
frame #5:  + 0x348d193 (0x7f73ce2bc193 in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libtorch_cpu.so)
frame #6: torch::jit::load(std::shared_ptr, c10::optional, std::unordered_map, std::equal_to, std::allocator > > ) + 0x193 (0x7f73ce2bd2f3 in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libtorch_cpu.so)
frame #7: torch::jit::load(std::string const , c10::optional, std::unordered_map, std::equal_to, std::allocator > > ) + 0xad (0x7f73ce2bf6bd in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libtorch_cpu.so)
frame #8: torch::jit::load(std::string const , c10::optional) + 0x54 (0x7f73ce2bf794 in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libtorch_cpu.so)
frame #9:  + 0x179de2 (0x7f73dfc2ade2 in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libbmnetp.so)
frame #10: bm::check(std::string const ) + 0x2f (0x7f73dfc2ed07 in /root/.local/lib/python3.7/site-packages/bmnetp/lib/libbmnetp.so)
frame #11: main + 0xdc (0x445195 in /root/.local/lib/python3.7/site-packages/bmnetp/bin/bmnetp.bin)
frame #12: __libc_start_main + 0xe7 (0x7f73c9873c87 in /lib/x86_64-linux-gnu/libc.so.6)
frame #13: _start + 0x2a (0x4418aa in /root/.local/lib/python3.7/site-packages/bmnetp/bin/bmnetp.bin)
Aborted
compile failed, exit code=134
134

更多回帖

发帖
×
20
完善资料,
赚取积分