bengreenfield825 / tf_object_detection2020 Goto Github PK
View Code? Open in Web Editor NEWA guide on how to setup TensorFlow Object Detection API in 2020
A guide on how to setup TensorFlow Object Detection API in 2020
Hi, I was able to follow the whole Tutorial, solving some minor issues found during the road, however in the last step:
python3 webcam_detection.py
to test the model with the webcam I got this error:
Traceback (most recent call last):
File "webcam_detection.py", line 76, in <module>
categories = label_map_util.convert_label_map_to_categories(label_map, max_num_classes=NUM_CLASSES, use_display_name=True)
File "/home/marvin/Desktop/models/research/object_detection/utils/label_map_util.py", line 133, in convert_label_map_to_categories
if item.HasField('frequency'):
ValueError: Protocol message StringIntLabelMapItem has no field frequency.
Could you add a license to your code? Legally, without a license, no one can use your code.
Whenever i run !python "generate_tfrecord.py" --csv_input="data/train_labels.csv" --output_path="train.record"
i get
/home/jupyterlab/conda/envs/python/lib/python3.6/site-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_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/jupyterlab/conda/envs/python/lib/python3.6/site-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_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:521: 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)])
/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:522: 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)])
/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:523: 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)])
/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:528: 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 "data/generate_tfrecord.py", line 103, in <module>
tf.app.run()
File "/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "data/generate_tfrecord.py", line 94, in main
tf_example = create_tf_example(group, path)
File "data/generate_tfrecord.py", line 49, in create_tf_example
encoded_jpg = fid.read()
File "/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 120, in read
self._preread_check()
File "/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/tensorflow/python/lib/io/file_io.py", line 80, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File "/home/jupyterlab/conda/envs/python/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 519, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: 2412b38afe2934ca255f6876cab3c5_jumbo.jpg; No such file or directory
line 76: od_graph_def = tf.gfile.GFile()
in start you are installing tensorflow 1.15 and when you open jupyter notebook in reserch->objection detection->colab_tutorials you are ignoring its ist cell where they are installing tf2.* and you didt focus on it.
So, the issue is tf1.15 does not support these tutorials
the error im facing while loading weights in each notebook same error
TypeError: load() missing 2 required positional arguments: 'tags' and 'export_dir'
When I run python generate_tfrecord.py --csv_input=data/test_labels.csv --output_path=data/test.record --image_dir=images/test/
I get
File "generate_tfrecord.py", line 104, in <module>
tf.app.run()
File "E:\Miniconda\lib\site-packages\tensorflow_core\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\Colin\AppData\Roaming\Python\Python37\site-packages\absl\app.py", line 299, in run
_run_main(main, args)
File "C:\Users\Colin\AppData\Roaming\Python\Python37\site-packages\absl\app.py", line 250, in _run_main
sys.exit(main(argv))
File "generate_tfrecord.py", line 95, in main
tf_example = create_tf_example(group, path)
File "generate_tfrecord.py", line 84, in create_tf_example
'image/object/class/label': dataset_util.int64_list_feature(classes),
File "E:\Miniconda\lib\site-packages\object_detection-0.1-py3.7.egg\object_detection\utils\dataset_util.py", line 30, in int64_list_feature
return tf.train.Feature(int64_list=tf.train.Int64List(value=value))
TypeError: None has type NoneType, but expected one of: int, long
As an output
I have change the pbtxt file and the generate_tfrecord file with my object and the id
i ran following command
python train.py --logtostderr \ --train_dir=./data \ --pipeline_config_path=data\cashew.config
and getting this error
\object_detection\data_decoders\tf_example_decoder.py", line 97, in __init__ lookup = contrib_lookup NameError: name 'contrib_lookup' is not defined
what is error means?
with the help of few changes we can make it run on tensorflow 2.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.