ImportError from image_utils
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- docker, python
- Domain
- machine-learning
Research direction
Start with resources/model_summaries/Dockerfile and test_summarize_model.py, then reproduce the failure at the mltk.core.summarize_model import described in the traceback. Done should mean the minimal example imports successfully and prints the model summary without the StatusCode ImportError.
Written by the indexing model from the issue text.
Description
Hi,
I hope I am correct here, a docker I have been using without problems for the past months started throwing an error today. The only difference I have noted recently on the docker I am using as my base image (tensorflow/tensorflow:latest-gpu) is that they have moved from python 3.10 to 3.11, so I have manually set python to Python 3.10.12 but the problem persists.
The error output is as follows
sys.exit(main())
File "/home/sources/TensorDSE/resources/model_summaries/CreateModelSummary.py", line 38, in main
SummarizeGraph(args.model, args.outputdir, args.outputname)
File "/home/sources/TensorDSE/resources/model_summaries/summarize.py", line 2, in SummarizeGraph
from mltk.core import summarize_model
File "/usr/local/lib/python3.10/dist-packages/mltk/core/__init__.py", line 7, in <module>
from .tflite_model import *
File "/usr/local/lib/python3.10/dist-packages/mltk/core/tflite_model/__init__.py", line 2, in <module>
from .tflite_model import (
File "/usr/local/lib/python3.10/dist-packages/mltk/core/tflite_model/tflite_model.py", line 13, in <module>
from . import tflite_schema as _tflite_schema_fb
File "/usr/local/lib/python3.10/dist-packages/mltk/core/tflite_model/tflite_schema.py", line 27, in <module>
from tflite_support.schema_py_generated import *
File "/usr/local/lib/python3.10/dist-packages/tflite_support/__init__.py", line 53, in <module>
from tflite_support import task
File "/usr/local/lib/python3.10/dist-packages/tflite_support/task/__init__.py", line 32, in <module>
from . import vision
File "/usr/local/lib/python3.10/dist-packages/tflite_support/task/vision/__init__.py", line 20, in <module>
from tensorflow_lite_support.python.task.vision import image_classifier
File "/usr/local/lib/python3.10/dist-packages/tensorflow_lite_support/python/task/vision/image_classifier.py", line 23, in <module>
from tensorflow_lite_support.python.task.vision.core import tensor_image
File "/usr/local/lib/python3.10/dist-packages/tensorflow_lite_support/python/task/vision/core/tensor_image.py", line 19, in <module>
from tensorflow_lite_support.python.task.vision.core.pybinds import image_utils
ImportError: generic_type: cannot initialize type "StatusCode": an object with that name is already defined
To recreate the error minimally the docker image can be pulled and run using this Dockerfile.
wget https://github.com/alxhoff/TensorDSE/raw/master/resources/model_summaries/Dockerfile
docker build -t tensorflow/tensorflow:latest-gpu .
docker run -it tensorflow/tensorflow:latest-gpu /bin/bash
and the minimal example should be there as test_summarize_model.py and should throw the error.
The code below is what is contained in test_summarize_model.py
from mltk.core import summarize_model
import wget
model_name = wget.download("https://github.com/alxhoff/TensorDSE/raw/master/resources/models/example_models/MNIST_full_quanitization.tflite")
summary = summarize_model(model_name, tflite=True)
print(summary)
If this is remotely the correct place to bring up an error like this please let me know what other information could be useful and a big thanks to anyone that takes the time to help.
Cheers,
Alex
- Dominant language
- C++
- Stars
- 442
- Forks
- 145
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tensorflow/tflite-support
-
`CreateFrameBufferFromBytes()` leaks acquired byte-array elements when `FrameBuffer` creation failsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tensorflow/tflite-support#1012 ·
-
Unchecked `GetStringUTFChars()` result and local-reference accumulation in the tokenizer JNI helpersOpen
Difficulty 3/5 1-2 days Newbie friendliness 76/100
tensorflow/tflite-support#1014 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
tensorflow/tflite-support#1011 · 1 comment ·
-
helloOpen
Difficulty 5/5 Over a week Newbie friendliness 1/100
tensorflow/tflite-support#1010 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
tensorflow/tflite-support#1006 · 1 comment ·
All issues in tensorflow/tflite-support
Similar issues
-
(S1 - Need confirmation)
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
CleverRaven/Cataclysm-DDA#89194 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
moonshine-ai/moonshine#231 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
documentation good first issue M7: multi-node no hardware needed
Difficulty 1/5 Under an hour Newbie friendliness 95/100
GageLawton/noise-cancellation#299 ·
Maintainers usually reply within 1 day