apple / apple/coremltools

NotImplementedError("rank of input must be 3 or 4!")

Open
#1,560 4 comments 0 reactions 0 assignees View on GitHub
bug tf2.x / tf.keras triaged
Dominant language
Python
Stars
5.4k
Forks
850
Avg merge
4d 5h
Merged PRs (30d)
10

Description

Hi,

I am trying to port google's RepNet [model](https://colab.research.google.com/github/google-research/google-research/blob/master/repnet/repnet_colab.ipynb) into the core ml framework. Model inferencing works fine but core ml throwing the error when we try to perform the conversion from tf model to the core ml framework.

[`traceback] (most recent call last):
File "/home/veeresh/anaconda3/envs/fraser_tf_26/lib/python3.7/site-packages/coremltools/converters/mil/frontend/tensorflow/converter.py", line 330, in convert_main_graph
outputs = convert_graph(self.context, graph, self.outputs)
File "/home/veeresh/anaconda3/envs/fraser_tf_26/lib/python3.7/site-packages/coremltools/converters/mil/frontend/tensorflow/convert_utils.py", line 189, in convert_graph
add_op(context, node)
File "/home/veeresh/anaconda3/envs/fraser_tf_26/lib/python3.7/site-packages/coremltools/converters/mil/frontend/tensorflow/ops.py", line 1951, in SpaceToBatchND
raise NotImplementedError("rank of input must be 3 or 4!")
NotImplementedError: rank of input must be 3 or 4!`

Setup :

Ubuntu 20.04
Python: 3.7.13
Tensorflow: 2.6.2
coremltools :5.2.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the TensorFlow-to-Core ML conversion from Google's RepNet notebook with the stated Python, TensorFlow, and coremltools versions. Read converters/mil/frontend/tensorflow/ops.py around SpaceToBatchND and the conversion path in converter.py and convert_utils.py. Done should include a confirmed explanation of the rank failure and a verified conversion outcome or a clear supported-case error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.