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

Getting ValueError: axes don't match array #934

Open
massanf opened this issue Jul 2, 2022 · 0 comments
Open

Getting ValueError: axes don't match array #934

massanf opened this issue Jul 2, 2022 · 0 comments

Comments

@massanf
Copy link

massanf commented Jul 2, 2022

Platform (like ubuntu 16.04/win10):
Ubuntu 22.04 LTS

Python version:
conda 4.13.0
Python 3.10.4

Source framework with version (like Tensorflow 1.4.1 with GPU):
Caffe

Destination framework with version (like CNTK 2.3 with GPU):
Tensorflow

Pre-trained model path (webpath or webdisk path):
https://github.com/henzler/single-image-tomography

Running scripts:
mmconvert -sf caffe -in deploy.prototxt -iw hourglass256x128x128_iter_150000.caffemodel -df tensorflow -om caffe

I want to run this model on my comptuer. I'm trying to convert it from Caffe to Tensorflow, but I'm having some difficulty in doing it. I really don't know what I'm doing or where I'm doing things wrong and I've been stuck here for hours. I would really be glad if someone could help.

I'm currently getting this error:

------------------------------------------------------------
    WARNING: PyCaffe not found!
    Falling back to a pure protocol buffer implementation.
    * Conversions will be drastically slower.
    * This backend is UNTESTED!
------------------------------------------------------------

Warning: parameters not reshaped for node: [BatchNorm] bn_conv1_b
Warning: parameters not reshaped for node: [BatchNorm] bn1_branch1
Warning: parameters not reshaped for node: [BatchNorm] bn1_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bn1_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bn1_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bn4_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bn4_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bn4_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bn5_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bn5_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bn5_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bn6_branch1
Warning: parameters not reshaped for node: [BatchNorm] bn6_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bn6_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bn6_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low1_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low1_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low1_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low2_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low2_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low2_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low5_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low5_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low5_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low1_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low1_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low1_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low2_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low2_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low2_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low5_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low5_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low5_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low1_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low1_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low1_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low2_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low2_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low2_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low5_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low5_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low5_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low1_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low1_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low1_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low2_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low2_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low2_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low5_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low5_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low5_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low6_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low6_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low6_branch2c
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low7_branch2a
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low7_branch2b
Warning: parameters not reshaped for node: [BatchNorm] bnhg1_low6_low6_low6_low7_branch2c
Traceback (most recent call last):
  File "/home/mfujita/anaconda3/envs/mmdnn/bin/mmconvert", line 8, in <module>
    sys.exit(_main())
  File "/home/mfujita/anaconda3/envs/mmdnn/lib/python3.10/site-packages/mmdnn/conversion/_script/convert.py", line 102, in _main
    ret = convertToIR._convert(ir_args)
  File "/home/mfujita/anaconda3/envs/mmdnn/lib/python3.10/site-packages/mmdnn/conversion/_script/convertToIR.py", line 16, in _convert
    transformer = CaffeTransformer(args.network, args.weights, "tensorflow", inputshape[0], phase = args.caffePhase)
  File "/home/mfujita/anaconda3/envs/mmdnn/lib/python3.10/site-packages/mmdnn/conversion/caffe/transformer.py", line 336, in __init__
    graph = graph.transformed([DataReshaper({ # Reshape the parameters to TensorFlow's ordering
  File "/home/mfujita/anaconda3/envs/mmdnn/lib/python3.10/site-packages/mmdnn/conversion/caffe/graph.py", line 287, in transformed
    graph = transformer(graph)
  File "/home/mfujita/anaconda3/envs/mmdnn/lib/python3.10/site-packages/mmdnn/conversion/caffe/transformer.py", line 151, in __call__
    node.reshaped_data = weights.transpose(transpose_order)
ValueError: axes don't match array
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

1 participant