tensorflow / tensorflow/models

TypeError: __init__(): incompatible constructor arguments

Open
#10,191 2 comments 2 reactions 3 assignees View on GitHub

@pkulzc is already working on this.

Since Aug 9, 2021.

models:research:odapi type:feature
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

Hi. Im getting the following error trying to start an object detection model in an enviroment. Im using windows 10

The code that i run:
python object_detection/model_main_tf2.py --pipeline_config_path "D:\data\Experiment_1\faster_rcnn_resnet50_v1_640x640_coco17_tpu-8.config" --model_dir "D:\data\Experiment_1\training_process" --alsologtostderr

The error it throws:

WARNING:tensorflow:Collective ops is not configured at program startup. Some performance features may not be enabled.
W0806 19:13:45.728498 5860 mirrored_strategy.py:379] Collective ops is not configured at program startup. Some performance features may not be enabled.
INFO:tensorflow:Using MirroredStrategy with devices ('/job:localhost/replica:0/task:0/device:GPU:0',)
I0806 19:13:45.884679 5860 mirrored_strategy.py:369] Using MirroredStrategy with devices ('/job:localhost/replica:0/task:0/device:GPU:0',)
Traceback (most recent call last):
File "object_detection/model_main_tf2.py", line 115, in
tf.compat.v1.app.run()
File "C:\Users\Mojtaba Sr\anaconda3\envs\tf2_gpu\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:\Users\Mojtaba Sr\anaconda3\envs\tf2_gpu\lib\site-packages\absl\app.py", line 303, in run
_run_main(main, args)
File "C:\Users\Mojtaba Sr\anaconda3\envs\tf2_gpu\lib\site-packages\absl\app.py", line 251, in _run_main
sys.exit(main(argv))
File "object_detection/model_main_tf2.py", line 106, in main
model_lib_v2.train_loop(
File "C:\Users\Mojtaba Sr\anaconda3\envs\tf2_gpu\lib\site-packages\object_detection\model_lib_v2.py", line 498, in train_loop
configs = get_configs_from_pipeline_file(
File "C:\Users\Mojtaba Sr\anaconda3\envs\tf2_gpu\lib\site-packages\object_detection\utils\config_util.py", line 138, in get_configs_from_pipeline_file
proto_str = f.read()
File "C:\Users\Mojtaba Sr\anaconda3\envs\tf2_gpu\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 117, in read
self._preread_check()
File "C:\Users\Mojtaba Sr\anaconda3\envs\tf2_gpu\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 79, in _preread_check
self._read_buf = _pywrap_file_io.BufferedInputStream(
TypeError: init(): incompatible constructor arguments. The following argument types are supported:
1. tensorflow.python.lib.io._pywrap_file_io.BufferedInputStream(filename: str, buffer_size: int, token: tensorflow.python.lib.io._pywrap_file_io.TransactionToken = None)

Invoked with: None, 524288

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.