Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: [Errno 2] No such file or directory: 'out/yolov2.param' #4

Open
GramJr opened this issue Sep 29, 2022 · 2 comments

Comments

@GramJr
Copy link

GramJr commented Sep 29, 2022

Hello, after

python train.py -d custom -v slim_yolo_v2 -hr -ms

i've got

Evaluating detections
Custom metric? Yes
AP for killer = -1.0000
AP for robokit = -1.0000
Mean AP = -1.0000
Mean AP: -1.0
Saving state, epoch: 10

and file slim_yolo_v2_10.pth in v831_yolo\weights\custom\slim_yolo_v2
Next i'm trying

python test.py -d custom -v slim_yolo_v2 --trained_model weights/custom/slim_yolo_v2/slim_yolo_v2_10.pth --visual_threshold 0.3 -size 224 --export

and i've got file yolov2.onnx in v831_yolo\out
AND

Traceback (most recent call last):
File "test.py", line 238, in
onnx_to_ncnn(input_shape, onnx=onnx_out, ncnn_param=ncnn_out_param, ncnn_bin=ncnn_out_bin)
File "C:\Users\Robozoom\Documents\MAIX2-releases\v831_yolo\convert.py", line 23, in onnx_to_ncnn
with open(ncnn_param) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'out/yolov2.param'

How i can generate *.param file?

Thanks!

@dianjixz
Copy link
Owner

You must be run it in linux system environment!

@GramJr
Copy link
Author

GramJr commented Oct 16, 2022

You must be run it in linux system environment!

I run it at goolge colab, at linux computer, on windows.
This is error at google colab:

use cuda
test on custom ...
/usr/local/lib/python3.7/dist-packages/torch/functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:2894.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
Finished loading model!

    Layer (type)               Output Shape         Param #

================================================================
Conv2d-1 [-1, 32, 224, 224] 896
BatchNorm2d-2 [-1, 32, 224, 224] 64
LeakyReLU-3 [-1, 32, 224, 224] 0
Conv_BN_LeakyReLU-4 [-1, 32, 224, 224] 0
Conv2d-5 [-1, 32, 112, 112] 9,248
BatchNorm2d-6 [-1, 32, 112, 112] 64
LeakyReLU-7 [-1, 32, 112, 112] 0
Conv_BN_LeakyReLU-8 [-1, 32, 112, 112] 0
Conv2d-9 [-1, 64, 112, 112] 18,496
BatchNorm2d-10 [-1, 64, 112, 112] 128
LeakyReLU-11 [-1, 64, 112, 112] 0
Conv_BN_LeakyReLU-12 [-1, 64, 112, 112] 0
Conv2d-13 [-1, 64, 56, 56] 36,928
BatchNorm2d-14 [-1, 64, 56, 56] 128
LeakyReLU-15 [-1, 64, 56, 56] 0
Conv_BN_LeakyReLU-16 [-1, 64, 56, 56] 0
Conv2d-17 [-1, 128, 56, 56] 73,856
BatchNorm2d-18 [-1, 128, 56, 56] 256
LeakyReLU-19 [-1, 128, 56, 56] 0
Conv_BN_LeakyReLU-20 [-1, 128, 56, 56] 0
Conv2d-21 [-1, 128, 28, 28] 147,584
BatchNorm2d-22 [-1, 128, 28, 28] 256
LeakyReLU-23 [-1, 128, 28, 28] 0
Conv_BN_LeakyReLU-24 [-1, 128, 28, 28] 0
Conv2d-25 [-1, 256, 28, 28] 295,168
BatchNorm2d-26 [-1, 256, 28, 28] 512
LeakyReLU-27 [-1, 256, 28, 28] 0
Conv_BN_LeakyReLU-28 [-1, 256, 28, 28] 0
Conv2d-29 [-1, 256, 14, 14] 590,080
BatchNorm2d-30 [-1, 256, 14, 14] 512
LeakyReLU-31 [-1, 256, 14, 14] 0
Conv_BN_LeakyReLU-32 [-1, 256, 14, 14] 0
Conv2d-33 [-1, 512, 14, 14] 1,180,160
BatchNorm2d-34 [-1, 512, 14, 14] 1,024
LeakyReLU-35 [-1, 512, 14, 14] 0
Conv_BN_LeakyReLU-36 [-1, 512, 14, 14] 0
Conv2d-37 [-1, 512, 7, 7] 2,359,808
BatchNorm2d-38 [-1, 512, 7, 7] 1,024
LeakyReLU-39 [-1, 512, 7, 7] 0
Conv_BN_LeakyReLU-40 [-1, 512, 7, 7] 0
DarkNet_Tiny-41 [[-1, 128, 28, 28], [-1, 256, 14, 14], [-1, 512, 7, 7]] 0
Conv2d-42 [-1, 512, 7, 7] 2,359,808
BatchNorm2d-43 [-1, 512, 7, 7] 1,024
LeakyReLU-44 [-1, 512, 7, 7] 0
Conv2d-45 [-1, 512, 7, 7] 0
Conv2d-46 [-1, 512, 7, 7] 2,359,808
BatchNorm2d-47 [-1, 512, 7, 7] 1,024
LeakyReLU-48 [-1, 512, 7, 7] 0
Conv2d-49 [-1, 512, 7, 7] 0
Conv2d-50 [-1, 512, 7, 7] 2,359,808
BatchNorm2d-51 [-1, 512, 7, 7] 1,024
LeakyReLU-52 [-1, 512, 7, 7] 0
Conv2d-53 [-1, 512, 7, 7] 0
Conv2d-54 [-1, 35, 7, 7] 17,955

Total params: 11,816,643
Trainable params: 11,816,643
Non-trainable params: 0

Input size (MB): 0.57
Forward/backward pass size (MB): 963780728.98
Params size (MB): 45.08
Estimated Total Size (MB): 963780774.63

input shape: torch.Size([1, 3, 224, 224])
export onnx ok
sh: 1: onnx2ncnn: not found
Traceback (most recent call last):
File "/content/ncnn/build/v831_yolo/test.py", line 238, in
onnx_to_ncnn(input_shape, onnx=onnx_out, ncnn_param=ncnn_out_param, ncnn_bin=ncnn_out_bin)
File "/content/ncnn/build/v831_yolo/convert.py", line 23, in onnx_to_ncnn
with open(ncnn_param) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/content/ncnn/build/v831_yolo/out/yolov2.param'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants