Skip to content

Add test data for ONNX - #499

Merged
alalek merged 6 commits into
opencv:3.4from
l-bat:l-bat/onnx_parser
Sep 10, 2018
Merged

alalek merged 6 commits into
opencv:3.4from
l-bat:l-bat/onnx_parser

Conversation

@l-bat

@l-bat l-bat commented Jul 30, 2018

Copy link
Copy Markdown
Contributor

No description provided.

@l-bat
l-bat force-pushed the l-bat/onnx_parser branch 2 times, most recently from 5abcb5f to 7e2f206 Compare August 8, 2018 07:22
@dkurt

dkurt commented Aug 13, 2018

Copy link
Copy Markdown
Member

@l-bat, please ammend the changes from this PR into a single commit to pass patch size warning. The thing is that git's history contains removed huge test data.

@l-bat
l-bat force-pushed the l-bat/onnx_parser branch from 002023c to 6e91338 Compare August 16, 2018 10:08
@alalek

alalek commented Aug 16, 2018

Copy link
Copy Markdown
Member

The first commit of this PR contains changes in testdata/cv/qrcode/dataset_config.json and other unrelated files.

Please grab rebased commits from here: https://github.com/alalek/opencv_extra/commits/pr499_rebase. Something like this:

git checkout -B save HEAD  # save current state
git fetch https://github.com/alalek/opencv pr499_rebase
git checkout -B l-bat/onnx_parser FETCH_HEAD
git push --force <fork_origin> l-bat/onnx_parser

@alalek

alalek commented Aug 16, 2018

Copy link
Copy Markdown
Member

Please take a look on download script. It doesn't work properly:

Model <AlexNet (ONNX)>
  expect c713be2852472582224fa7395e2ab4641f8b6356
  catch [Errno 2] No such file or directory: 'bvlc_alexnet.tar.gz'
  hash check failed - downloading
  get https://s3.amazonaws.com/download.onnx/models/opset_8/bvlc_alexnet.tar.gz
  200 OK [220 Mb]
  progress >>>>>>>>>>>>>>>>>>>>>>> done
 file bvlc_alexnet.tar.gz
  expect c713be2852472582224fa7395e2ab4641f8b6356
  actual c713be2852472582224fa7395e2ab4641f8b6356
Model <AlexNet (ONNX)>
  expect b256703f2b125d8681a0a6e5a40a6c9deb7d2b4b
  catch [Errno 2] No such file or directory: 'onnx/models/alexnet.onnx'
  hash check failed - extracting
  get bvlc_alexnet/model.onnx
Traceback (most recent call last):
  File "/home/alalek/download_models.py", line 692, in <module>
    m.get()
  File "/home/alalek/download_models.py", line 63, in get
    self.extract()
  File "/home/alalek/download_models.py", line 82, in extract
    self.save(f.extractfile(self.member))
  File "/home/alalek/download_models.py", line 85, in save
    with open(self.filename, 'wb') as f:
IOError: [Errno 2] No such file or directory: 'onnx/models/alexnet.onnx'

List of files in archive:

$ tar -tf bvlc_alexnet.tar.gz
bvlc_alexnet/
bvlc_alexnet/test_data_0.npz
bvlc_alexnet/test_data_2.npz
bvlc_alexnet/test_data_1.npz
bvlc_alexnet/test_data_set_0/
bvlc_alexnet/test_data_set_0/input_0.pb
bvlc_alexnet/test_data_set_0/output_0.pb
bvlc_alexnet/test_data_set_1/
bvlc_alexnet/test_data_set_1/input_0.pb
bvlc_alexnet/test_data_set_1/output_0.pb
bvlc_alexnet/test_data_set_2/
bvlc_alexnet/test_data_set_2/input_0.pb
bvlc_alexnet/test_data_set_2/output_0.pb
bvlc_alexnet/test_data_set_3/
bvlc_alexnet/test_data_set_3/input_0.pb
bvlc_alexnet/test_data_set_3/output_0.pb
bvlc_alexnet/test_data_set_4/
bvlc_alexnet/test_data_set_4/input_0.pb
bvlc_alexnet/test_data_set_4/output_0.pb
bvlc_alexnet/test_data_set_5/
bvlc_alexnet/test_data_set_5/input_0.pb
bvlc_alexnet/test_data_set_5/output_0.pb
bvlc_alexnet/model.onnx

@l-bat
l-bat force-pushed the l-bat/onnx_parser branch from 0ad26d2 to 3c8e17d Compare August 17, 2018 06:38
@l-bat

l-bat commented Aug 17, 2018

Copy link
Copy Markdown
Contributor Author

I updated pull request and run script download_models.py from folder dnn/. All models downloaded successfully.

@alalek

alalek commented Aug 17, 2018

Copy link
Copy Markdown
Member

Download problem is still here, just remove mentioned file from your local system.

@alalek

alalek commented Aug 17, 2018

Copy link
Copy Markdown
Member

@mshabunin Could you prepare patch for models from here based on your PR #503 ?

reshaped = tf.reshape(flatten, tf.shape(inp), 'reshape')
save(inp, reshaped, 'reshape_as_shape', optimize=False)
################################################################################
with tf.gfile.FastGFile('../mask_rcnn_inception_v2_coco_2018_01_28.pb') as f:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@l-bat, please rebase this PR to restore this file and mask_rcnn_inception_v2_coco_2018_01_28.pbtxt.

@l-bat
l-bat force-pushed the l-bat/onnx_parser branch from 5a482d7 to 17f3928 Compare August 27, 2018 06:21
@l-bat
l-bat force-pushed the l-bat/onnx_parser branch from 17f3928 to 350c93e Compare September 4, 2018 12:34
@alalek
alalek merged commit 809f299 into opencv:3.4 Sep 10, 2018
@l-bat
l-bat deleted the l-bat/onnx_parser branch September 13, 2018 09:41
@alalek alalek mentioned this pull request Sep 14, 2018
input1 = Variable(torch.randn(1, 2, 2, 2))
input2 = Variable(torch.randn(1, 2, 2, 2))
model = MultyInputs()
save_data_and_model_multy_inputs("multy_inputs", model, input1, input2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like generated file "output_multy_inputs.npy" is missing from this PR:

[ RUN      ] Test_ONNX_layers.MultyInputs/0, where GetParam() = OCV/CPU
[     SKIP ] OpenCV tests: Can't find data file: dnn/onnx/data/output_multy_inputs.npy
[       OK ] Test_ONNX_layers.MultyInputs/0 (1 ms)

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

Successfully merging this pull request may close these issues.

4 participants