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

A model training problem for plant disease detection #11189

Open
MAXTe21 opened this issue Apr 6, 2024 · 10 comments
Open

A model training problem for plant disease detection #11189

MAXTe21 opened this issue Apr 6, 2024 · 10 comments
Assignees

Comments

@MAXTe21
Copy link

MAXTe21 commented Apr 6, 2024

I encountered a small problem when training tensorflow ssd_mobilenet model on Google colab. There were no problems with data set processing and preprocessing model import. However, during the final training, some modules may have been unavailable due to version incompatibility. (Or the citation keeps getting wrong), similar problems have always been there, I would like to ask those experts to help me, I have just started to contact these, and some problems have been bothering me. :(

@MAXTe21
Copy link
Author

MAXTe21 commented Apr 6, 2024

Error message is:
Traceback (most recent call last):
File "/content/drive/MyDrive/5:30_models/research/object_detection/model_main_tf2.py", line 31, in
from object_detection import model_lib_v2
ImportError: cannot import name 'model_lib_v2' from 'object_detection' (/usr/local/lib/python3.10/dist-packages/object_detection/init.py)

Error from this code:
!python /content/drive/MyDrive/5:30_models/research/object_detection/model_main_tf2.py
--pipeline_config_path=/content/drive/MyDrive/5:30_models/research/object_detection/configs/tf2/ssd_mobilenet_v2_fpnlite_320x320_coco17_tpu-8.config
--model_dir=/content/drive/MyDrive/Trainingssd_Final
--num_steps=35000

I try to train but always have some problem. like: ''ImportError: cannot import name 'estimator' from 'tensorflow.compat.v1''and
''ImportError: cannot import name 'model_lib_v2' from 'object_detection'' is the most common

@MAXTe21
Copy link
Author

MAXTe21 commented Apr 6, 2024

About my version information, I run '!pip list' code
These (parts) appeared:
keras 3.1.1
numpy 1.25.2
opencv-python 4.8.0.76
pip 23.1.2
pip-tools 6.13.0
python-apt 0.0.0
python-box 7.1.1
python-dateutil 2.8.2
python-louvain 0.16
python-slugify 8.0.4
python-utils 3.8.2
tensorboard-data-server 0.7.2
tensorflow 2.16.1
tensorflow-datasets 4.9.4
tensorflow-estimator 2.15.0
tensorflow-gcs-config 2.15.0
tensorflow-hub 0.16.1
tensorflow-io-gcs-filesystem 0.36.0
tensorflow-metadata 1.14.0
tensorflow-object-detection-api 0.1.1
tensorflow-probability 0.23.0
tensorstore 0.1.45

If you need any other module (library) version information, please tell me

@MAXTe21
Copy link
Author

MAXTe21 commented Apr 6, 2024

This is the other part of the colab code that I use to get some files and modules

'' !git clone https://github.com/tensorflow/models.git '/content/drive/My Drive/5:30_models' ''
and
'' %%bash
cd /content/drive/MyDrive/5:30_models/research/
protoc object_detection/protos/*.proto --python_out=.
cp object_detection/packages/tf2/setup.py .
python -m pip install . ''

@MAXTe21 MAXTe21 closed this as completed Apr 6, 2024
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@MAXTe21 MAXTe21 reopened this Apr 6, 2024
@MAXTe21
Copy link
Author

MAXTe21 commented Apr 6, 2024

This is the other part of the colab code that I use to get some files and modules:
'' !git clone https://github.com/tensorflow/models.git '/content/drive/My Drive/5:30_models' ''
and :
'' %%bash
cd /content/drive/MyDrive/5:30_models/research/
protoc object_detection/protos/*.proto --python_out=.
cp object_detection/packages/tf2/setup.py .
python -m pip install . ''

@MAXTe21
Copy link
Author

MAXTe21 commented Apr 6, 2024

I checked the relevant information on the Internet and the code that reported the same error, but I didn't find a good solution. I'm just a beginner and don't know much about these.
I want to upload the tensorflow_models file I downloaded from github. I have changed the parameters of some files in it and prepared them for training, but the file is too large and the upload failed.
I will provide any information you need about this project, please help me ,thank you!!! :)

@laxmareddyp
Copy link
Collaborator

Hi @MAXTe21 ,

Support for the older codebase has been discontinued. Could you kindly utilize the official Object Detection models provided by TensorFlow Model Garden.

Thanks.

@laxmareddyp laxmareddyp added the stat:awaiting response Waiting on input from the contributor label Apr 8, 2024
Copy link

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Apr 16, 2024
@SanjayDurai
Copy link

hey MAXTe21 Please help me out if you have fixed this issue im exactly getting the same error when i try to train my model

@google-ml-butler google-ml-butler bot removed stale stat:awaiting response Waiting on input from the contributor labels Apr 18, 2024
@MAXTe21
Copy link
Author

MAXTe21 commented Apr 21, 2024

hey MAXTe21 Please help me out if you have fixed this issue im exactly getting the same error when i try to train my model

I solved it, but the method I used is not very good. After consulting a lot of online information, I found that this should be a version incompatibility problem, and no one told me how to solve it by modifying the source code of tensoflow, so I kept trying to re-download the version, and in jupyter notebook Use the conda virtual environment to keep retrying, and finally it succeeded, but I spent a lot of time, and to be honest, I don't know exactly how to solve it, I just kept retrying to download the version.
For details, you can refer to this website https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/index.html
I followed the steps above to download version 2.16.1 of tensorflow, then reinstalled it one by one according to its compatible versions, and finally started training successfully.

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

No branches or pull requests

3 participants