Click here to Skip to main content
15,848,319 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've been trying to implement this collab code https://colab.research.google.com/drive/11ko0DBnI1QLxVoJQR8gt9b4JDcvbCrtU#scrollTo=PhAuO2-1ZBnv but encountered this error in TRAINING part of the code:-


--pipeline_config_path={config_path + pipeline_file} \
   --model_dir={model_dir} \
   --alsologtostderr \
   --num_train_steps={num_steps} \
   --num_eval_steps={num_eval_steps}


This is the error message I get:-

/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
/usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/usr/local/lib/python3.7/dist-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
  File "/content/gun_detection/models/research/object_detection/model_main.py", line 25, in <module>
    from object_detection import model_lib
  File "/content/gun_detection/models/research/object_detection/model_lib.py", line 30, in <module>
    from object_detection import exporter as exporter_lib
  File "/content/gun_detection/models/research/object_detection/exporter.py", line 24, in <module>
    from object_detection.builders import model_builder
  File "/content/gun_detection/models/research/object_detection/builders/model_builder.py", line 37, in <module>
    from object_detection.meta_architectures import deepmac_meta_arch
  File "/content/gun_detection/models/research/object_detection/meta_architectures/deepmac_meta_arch.py", line 19, in <module>
    from object_detection.models.keras_models import resnet_v1
  File "/content/gun_detection/models/research/object_detection/models/keras_models/resnet_v1.py", line 22, in <module>
    from tensorflow.python.keras.applications import resnet
ImportError: cannot import name 'resnet' from 'tensorflow.python.keras.applications' (/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/applications/__init__.py)


What I have tried:

I followed the link as it is. But getting these errors. Can't seem to find any solution to this error in google. Please help me. I'm not good at this.

P.S: The Python version I'm using is 3.7.12 and tensorflow version is 1.14.
Posted
Updated 30-Sep-21 22:45pm
Comments
maverick maiden 30-Sep-21 22:28pm    
I tried this:
from tensorflow.keras.applications import resnet50

But gives me the error:
ImportError: cannot import name 'resnet' from 'tensorflow.python.keras.applications' (/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/applications/__init__.py)

T did this too: from tf.keras.applications.resnet import ResNet50
But gets: ModuleNotFoundError: No module named 'tf'

1 solution

Instead of trying to guess what to do you should check the documentation: The Sequential model  |  TensorFlow Core[^].
 
Share this answer
 
Comments
maverick maiden 1-Oct-21 5:29am    
Thank you so much for your suggestion. I checked out the Sequential model and am little confused here. Might be asking a silly question but Can I implement various models like SSD, FRCNN, RCNN, etc using this sequential model? Would you please guide me a lil bit here? Thanks!
Richard MacCutchan 1-Oct-21 6:05am    
Sorry, this is the Quick Answers forum. There is not space to teach you how to use some third-party library, you need to study its documentation.
maverick maiden 1-Oct-21 6:16am    
okay. Thanks!
maverick maiden 1-Oct-21 6:17am    
But have you got any idea if I can use this said sequential model for implementing ssd, frcnn, etc?
Richard MacCutchan 1-Oct-21 6:27am    
Sorry, no, I have not used Tensorflow. The documentation is the place to look.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900