tensorflow / models

Models and examples built with TensorFlow
Other
77.16k stars 45.76k forks source link

InvalidArgumentError: TypeError: 'numpy.float64' object cannot be interpreted as an integer #2961

Closed monomon closed 4 years ago

monomon commented 6 years ago

System information

Describe the problem

I recently updated tensorflow and numpy from pip. During training, I started getting this error:

tensorflow.python.framework.errors_impl.InvalidArgumentError: TypeError: 'numpy.float64' object cannot be interpreted as an integer

After the error training fails.

I found a similar-sounding issue: https://github.com/rbgirshick/py-faster-rcnn/issues/625

So perhaps the easy workaround is to cast the float to int before the call, or define the datatype explicitly if it is in a tensor. I wasn't able to find the location where it fails (see log below).

Source code / logs

Find a complete traceback here: https://pastebin.com/97cKf5QT

reedwm commented 6 years ago

/CC @jch1, can you fix this?

tensorflowbutler commented 4 years ago

Hi There, We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

revrr commented 4 years ago

I get the same error:

INFO:tensorflow:loss = 0.365541, step = 2118 (108.686 sec) I0302 04:30:12.375137 139849259779904 basic_session_run_hooks.py:260] loss = 0.365541, step = 2118 (108.686 sec) INFO:tensorflow:global_step/sec: 0.95334 I0302 04:31:57.268882 139849259779904 basic_session_run_hooks.py:692] global_step/sec: 0.95334 INFO:tensorflow:loss = 0.0513791, step = 2218 (104.894 sec) I0302 04:31:57.269407 139849259779904 basic_session_run_hooks.py:260] loss = 0.0513791, step = 2218 (104.894 sec) INFO:tensorflow:global_step/sec: 0.952867 I0302 04:33:42.215290 139849259779904 basic_session_run_hooks.py:692] global_step/sec: 0.952867 INFO:tensorflow:loss = 0.91536176, step = 2318 (104.947 sec) I0302 04:33:42.216015 139849259779904 basic_session_run_hooks.py:260] loss = 0.91536176, step = 2318 (104.947 sec) INFO:tensorflow:Saving checkpoints for 2374 into training/model.ckpt. I0302 04:34:40.891496 139849259779904 basic_session_run_hooks.py:606] Saving checkpoints for 2374 into training/model.ckpt. WARNING:tensorflow:From /home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py:963: remove_checkpoint (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to delete files with this prefix. W0302 04:34:40.957309 139849259779904 deprecation.py:323] From /home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/saver.py:963: remove_checkpoint (from tensorflow.python.training.checkpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to delete files with this prefix. INFO:tensorflow:Calling model_fn. I0302 04:34:42.004164 139849259779904 estimator.py:1148] Calling model_fn. INFO:tensorflow:Scale of 0 disables regularizer. I0302 04:34:43.114418 139849259779904 regularizers.py:98] Scale of 0 disables regularizer. INFO:tensorflow:Scale of 0 disables regularizer. I0302 04:34:43.125037 139849259779904 regularizers.py:98] Scale of 0 disables regularizer. INFO:tensorflow:depth of additional conv before box predictor: 0 I0302 04:34:43.125357 139849259779904 convolutional_box_predictor.py:151] depth of additional conv before box predictor: 0 INFO:tensorflow:Scale of 0 disables regularizer. I0302 04:34:43.907465 139849259779904 regularizers.py:98] Scale of 0 disables regularizer. INFO:tensorflow:Scale of 0 disables regularizer. I0302 04:34:43.919048 139849259779904 regularizers.py:98] Scale of 0 disables regularizer. WARNING:tensorflow:From /home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/util/dispatch.py:180: batch_gather (from tensorflow.python.ops.array_ops) is deprecated and will be removed after 2017-10-25. Instructions for updating: tf.batch_gather is deprecated, please use tf.gather with batch_dims=-1 instead. W0302 04:34:44.250046 139849259779904 deprecation.py:323] From /home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/util/dispatch.py:180: batch_gather (from tensorflow.python.ops.array_ops) is deprecated and will be removed after 2017-10-25. Instructions for updating: tf.batch_gather is deprecated, please use tf.gather with batch_dims=-1 instead. WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/eval_util.py:796: to_int64 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. W0302 04:34:44.789323 139849259779904 deprecation.py:323] From /usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/eval_util.py:796: to_int64 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/utils/visualization_utils.py:498: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version. Instructions for updating: tf.py_func is deprecated in TF V2. Instead, there are two options available in V2.

W0302 04:34:44.925954 139849259779904 deprecation.py:323] From /usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/utils/visualization_utils.py:498: py_func (from tensorflow.python.ops.script_ops) is deprecated and will be removed in a future version. Instructions for updating: tf.py_func is deprecated in TF V2. Instead, there are two options available in V2.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/utils/visualization_utils.py:1044: The name tf.summary.image is deprecated. Please use tf.compat.v1.summary.image instead.

W0302 04:34:45.028621 139849259779904 module_wrapper.py:139] From /usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/utils/visualization_utils.py:1044: The name tf.summary.image is deprecated. Please use tf.compat.v1.summary.image instead.

WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/model_lib.py:484: The name tf.metrics.mean is deprecated. Please use tf.compat.v1.metrics.mean instead.

W0302 04:34:45.087543 139849259779904 module_wrapper.py:139] From /usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/model_lib.py:484: The name tf.metrics.mean is deprecated. Please use tf.compat.v1.metrics.mean instead.

INFO:tensorflow:Done calling model_fn. I0302 04:34:45.314840 139849259779904 estimator.py:1150] Done calling model_fn. INFO:tensorflow:Starting evaluation at 2020-03-02T04:34:45Z I0302 04:34:45.326640 139849259779904 evaluation.py:255] Starting evaluation at 2020-03-02T04:34:45Z INFO:tensorflow:Graph was finalized. I0302 04:34:45.638996 139849259779904 monitored_session.py:240] Graph was finalized. 2020-03-02 04:34:45.639936: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:983] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero 2020-03-02 04:34:45.640525: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1618] Found device 0 with properties: name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.455 pciBusID: 0000:01:00.0 2020-03-02 04:34:45.640701: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcudart.so.10.0'; dlerror: libcudart.so.10.0: cannot open shared object file: No such file or directory 2020-03-02 04:34:45.640806: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcublas.so.10.0'; dlerror: libcublas.so.10.0: cannot open shared object file: No such file or directory 2020-03-02 04:34:45.640880: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcufft.so.10.0'; dlerror: libcufft.so.10.0: cannot open shared object file: No such file or directory 2020-03-02 04:34:45.640924: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcurand.so.10.0'; dlerror: libcurand.so.10.0: cannot open shared object file: No such file or directory 2020-03-02 04:34:45.641039: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusolver.so.10.0'; dlerror: libcusolver.so.10.0: cannot open shared object file: No such file or directory 2020-03-02 04:34:45.641109: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcusparse.so.10.0'; dlerror: libcusparse.so.10.0: cannot open shared object file: No such file or directory 2020-03-02 04:34:45.641124: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library libcudnn.so.7 2020-03-02 04:34:45.641130: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1641] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform. Skipping registering GPU devices... 2020-03-02 04:34:45.641141: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1159] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-03-02 04:34:45.641146: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1165] 0 2020-03-02 04:34:45.641152: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1178] 0: N INFO:tensorflow:Restoring parameters from training/model.ckpt-2374 I0302 04:34:45.641930 139849259779904 saver.py:1284] Restoring parameters from training/model.ckpt-2374 INFO:tensorflow:Running local_init_op. I0302 04:34:46.374262 139849259779904 session_manager.py:500] Running local_init_op. INFO:tensorflow:Done running local_init_op. I0302 04:34:46.488706 139849259779904 session_manager.py:502] Done running local_init_op. INFO:tensorflow:Performing evaluation on 130 images. I0302 04:35:39.281298 139844202264320 coco_evaluation.py:205] Performing evaluation on 130 images. creating index... index created! INFO:tensorflow:Loading and preparing annotation results... I0302 04:35:39.284096 139844202264320 coco_tools.py:115] Loading and preparing annotation results... INFO:tensorflow:DONE (t=0.02s) I0302 04:35:39.305804 139844202264320 coco_tools.py:137] DONE (t=0.02s) creating index... index created! 2020-03-02 04:35:39.325579: W tensorflow/core/framework/op_kernel.cc:1639] Invalid argument: TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer. Traceback (most recent call last):

File "/home/ricardo/.local/lib/python3.6/site-packages/numpy/core/function_base.py", line 117, in linspace num = operator.index(num)

TypeError: 'numpy.float64' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/script_ops.py", line 235, in call ret = func(*args)

File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/metrics/coco_evaluation.py", line 384, in first_value_func self._metrics = self.evaluate()

File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/metrics/coco_evaluation.py", line 215, in evaluate coco_wrapped_groundtruth, coco_wrapped_detections, agnostic_mode=False)

File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/metrics/coco_tools.py", line 176, in init iouType=iou_type)

File "/home/ricardo/.local/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 76, in init self.params = Params(iouType=iouType) # parameters

File "/home/ricardo/.local/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 527, in init self.setDetParams()

File "/home/ricardo/.local/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 507, in setDetParams self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)

File "<__array_function__ internals>", line 6, in linspace

File "/home/ricardo/.local/lib/python3.6/site-packages/numpy/core/function_base.py", line 121, in linspace .format(type(num)))

TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.

Traceback (most recent call last): File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call return fn(*args) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn target_list, run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.OutOfRangeError: End of sequence [[{{node IteratorGetNext}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/evaluation.py", line 272, in _evaluate_once session.run(eval_ops, feed_dict) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 754, in run run_metadata=run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1259, in run run_metadata=run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1360, in run raise six.reraise(original_exc_info) File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise raise value File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1345, in run return self._sess.run(args, *kwargs) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1418, in run run_metadata=run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1176, in run return self._sess.run(args, **kwargs) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 956, in run run_metadata_ptr) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1180, in _run feed_dict_tensor, options, run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.OutOfRangeError: End of sequence [[node IteratorGetNext (defined at /home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]

Original stack trace for 'IteratorGetNext': File "model_main.py", line 114, in tf.app.run() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/ricardo/.local/lib/python3.6/site-packages/absl/app.py", line 299, in run _run_main(main, args) File "/home/ricardo/.local/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main sys.exit(main(argv)) File "model_main.py", line 110, in main tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0]) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 473, in train_and_evaluate return executor.run() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run return self.run_local() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_local saving_listeners=saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 370, in train loss = self._train_model(input_fn, hooks, saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1161, in _train_model return self._train_model_default(input_fn, hooks, saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1195, in _train_model_default saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1494, in _train_with_estimatorspec , loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss]) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 754, in run run_metadata=run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1259, in run run_metadata=run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1345, in run return self._sess.run(*args, *kwargs) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1426, in run run_metadata=run_metadata)) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/basic_session_run_hooks.py", line 594, in after_run if self._save(run_context.session, global_step): File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/basic_session_run_hooks.py", line 619, in _save if l.after_save(session, step): File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 519, in after_save self._evaluate(global_step_value) # updates self.eval_result File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 539, in _evaluate self._evaluator.evaluate_and_export()) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 920, in evaluate_and_export hooks=self._eval_spec.hooks) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 480, in evaluate name=name) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 522, in _actual_eval return _evaluate() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 504, in _evaluate self._evaluate_build_graph(input_fn, hooks, checkpoint_path)) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1511, in _evaluate_build_graph self._call_model_fn_eval(input_fn, self.config)) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1544, in _call_model_fn_eval input_fn, ModeKeys.EVAL) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1025, in _get_features_and_labels_from_input_fn self._call_input_fn(input_fn, mode)) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/util.py", line 65, in parse_input_fn_result result = iterator.get_next() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/data/ops/iterator_ops.py", line 426, in get_next name=name) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_dataset_ops.py", line 2518, in iterator_get_next output_shapes=output_shapes, name=name) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper op_def=op_def) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func return func(args, **kwargs) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op attrs, op_def, compute_device) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal op_def=op_def) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 1748, in init self._traceback = tf_stack.extract_stack()

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call return fn(*args) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn target_list, run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer. Traceback (most recent call last):

File "/home/ricardo/.local/lib/python3.6/site-packages/numpy/core/function_base.py", line 117, in linspace num = operator.index(num)

TypeError: 'numpy.float64' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/script_ops.py", line 235, in call ret = func(*args)

File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/metrics/coco_evaluation.py", line 384, in first_value_func self._metrics = self.evaluate()

File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/metrics/coco_evaluation.py", line 215, in evaluate coco_wrapped_groundtruth, coco_wrapped_detections, agnostic_mode=False)

File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/metrics/coco_tools.py", line 176, in init iouType=iou_type)

File "/home/ricardo/.local/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 76, in init self.params = Params(iouType=iouType) # parameters

File "/home/ricardo/.local/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 527, in init self.setDetParams()

File "/home/ricardo/.local/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 507, in setDetParams self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)

File "<__array_function__ internals>", line 6, in linspace

File "/home/ricardo/.local/lib/python3.6/site-packages/numpy/core/function_base.py", line 121, in linspace .format(type(num)))

TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.

 [[{{node PyFunc_3}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "model_main.py", line 114, in tf.app.run() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/ricardo/.local/lib/python3.6/site-packages/absl/app.py", line 299, in run _run_main(main, args) File "/home/ricardo/.local/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main sys.exit(main(argv)) File "model_main.py", line 110, in main tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0]) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 473, in train_and_evaluate return executor.run() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run return self.run_local() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_local saving_listeners=saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 370, in train loss = self._train_model(input_fn, hooks, saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1161, in _train_model return self._train_model_default(input_fn, hooks, saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1195, in _train_model_default saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1494, in _train_with_estimatorspec , loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss]) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 754, in run run_metadata=run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1259, in run run_metadata=run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1360, in run raise six.reraise(original_exc_info) File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise raise value File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1345, in run return self._sess.run(args, **kwargs) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1426, in run run_metadata=run_metadata)) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/basic_session_run_hooks.py", line 594, in after_run if self._save(run_context.session, global_step): File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/basic_session_run_hooks.py", line 619, in _save if l.after_save(session, step): File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 519, in after_save self._evaluate(global_step_value) # updates self.eval_result File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 539, in _evaluate self._evaluator.evaluate_and_export()) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 920, in evaluate_and_export hooks=self._eval_spec.hooks) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 480, in evaluate name=name) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 522, in _actual_eval return _evaluate() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 511, in _evaluate output_dir=self.eval_dir(name)) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1619, in _evaluate_run config=self._session_config) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/evaluation.py", line 272, in _evaluate_once session.run(eval_ops, feed_dict) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 861, in exit self._close_internal(exception_type) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 894, in _close_internal h.end(self._coordinated_creator.tf_sess) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/basic_session_run_hooks.py", line 951, in end self._final_ops, feed_dict=self._final_ops_feed_dict) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 956, in run run_metadata_ptr) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1180, in _run feed_dict_tensor, options, run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1359, in _do_run run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/client/session.py", line 1384, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer. Traceback (most recent call last):

File "/home/ricardo/.local/lib/python3.6/site-packages/numpy/core/function_base.py", line 117, in linspace num = operator.index(num)

TypeError: 'numpy.float64' object cannot be interpreted as an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/script_ops.py", line 235, in call ret = func(*args)

File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/metrics/coco_evaluation.py", line 384, in first_value_func self._metrics = self.evaluate()

File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/metrics/coco_evaluation.py", line 215, in evaluate coco_wrapped_groundtruth, coco_wrapped_detections, agnostic_mode=False)

File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/metrics/coco_tools.py", line 176, in init iouType=iou_type)

File "/home/ricardo/.local/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 76, in init self.params = Params(iouType=iouType) # parameters

File "/home/ricardo/.local/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 527, in init self.setDetParams()

File "/home/ricardo/.local/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 507, in setDetParams self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)

File "<__array_function__ internals>", line 6, in linspace

File "/home/ricardo/.local/lib/python3.6/site-packages/numpy/core/function_base.py", line 121, in linspace .format(type(num)))

TypeError: object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.

 [[node PyFunc_3 (defined at /home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py:1748) ]]

Original stack trace for 'PyFunc_3': File "model_main.py", line 114, in tf.app.run() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/platform/app.py", line 40, in run _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef) File "/home/ricardo/.local/lib/python3.6/site-packages/absl/app.py", line 299, in run _run_main(main, args) File "/home/ricardo/.local/lib/python3.6/site-packages/absl/app.py", line 250, in _run_main sys.exit(main(argv)) File "model_main.py", line 110, in main tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0]) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 473, in train_and_evaluate return executor.run() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run return self.run_local() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_local saving_listeners=saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 370, in train loss = self._train_model(input_fn, hooks, saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1161, in _train_model return self._train_model_default(input_fn, hooks, saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1195, in _train_model_default saving_listeners) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1494, in _train_with_estimatorspec , loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss]) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 754, in run run_metadata=run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1259, in run run_metadata=run_metadata) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1345, in run return self._sess.run(args, kwargs) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/monitored_session.py", line 1426, in run run_metadata=run_metadata)) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/basic_session_run_hooks.py", line 594, in after_run if self._save(run_context.session, global_step): File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/training/basic_session_run_hooks.py", line 619, in _save if l.after_save(session, step): File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 519, in after_save self._evaluate(global_step_value) # updates self.eval_result File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 539, in _evaluate self._evaluator.evaluate_and_export()) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 920, in evaluate_and_export hooks=self._eval_spec.hooks) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 480, in evaluate name=name) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 522, in _actual_eval return _evaluate() File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 504, in _evaluate self._evaluate_build_graph(input_fn, hooks, checkpoint_path)) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1511, in _evaluate_build_graph self._call_model_fn_eval(input_fn, self.config)) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1547, in _call_model_fn_eval features, labels, ModeKeys.EVAL, config) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1149, in _call_model_fn model_fn_results = self._model_fn(features=features, kwargs) File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/model_lib.py", line 482, in model_fn eval_config, list(category_index.values()), eval_dict) File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/eval_util.py", line 947, in get_eval_metric_ops_for_evaluators eval_dict)) File "/usr/local/lib/python3.6/dist-packages/object_detection-0.1-py3.6.egg/object_detection/metrics/coco_evaluation.py", line 394, in get_estimator_eval_metric_ops first_value_op = tf.py_func(first_value_func, [], tf.float32) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/util/deprecation.py", line 324, in new_func return func(args, *kwargs) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/script_ops.py", line 513, in py_func return py_func_common(func, inp, Tout, stateful, name=name) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/script_ops.py", line 495, in py_func_common func=func, inp=inp, Tout=Tout, stateful=stateful, eager=False, name=name) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/script_ops.py", line 318, in _internal_py_func input=inp, token=token, Tout=Tout, name=name) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/ops/gen_script_ops.py", line 170, in py_func "PyFunc", input=input, token=token, Tout=Tout, name=name) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper op_def=op_def) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func return func(args, **kwargs) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op attrs, op_def, compute_device) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal op_def=op_def) File "/home/ricardo/.local/lib/python3.6/site-packages/tensorflow_core/python/framework/ops.py", line 1748, in init self._traceback = tf_stack.extract_stack()

aish-where-ya commented 4 years ago

This issue has been solved here - https://github.com/rbgirshick/py-faster-rcnn/issues/481

EnricoBeltramo commented 4 years ago

In https://github.com/rbgirshick/py-faster-rcnn/issues/481 propose to switch to numpy 1.11.0, that is incompatible with tensorflow 1.15. There is a better fix?

kaisubr commented 4 years ago

@EnricoBeltramo Was stuck with the same issue for a long time. I fixed it by downgrading to numpy 1.17.4. This works with tensorflow 1.15.2. Check out https://stackoverflow.com/questions/54099081/how-to-fix-numpy-float64-object-cannot-be-interpreted-as-an-integer.

%tensorflow_version 1.x
import tensorflow as tf
print(tf.__version__)
!pip install numpy==1.17.4

Hope that works for you as well!

syafiq32 commented 4 years ago

my error is TypeError: 'numpy.float64' object cannot be interpreted as an integer. how to solve it ...

help me please

jackyvr commented 4 years ago

my error is TypeError: 'numpy.float64' object cannot be interpreted as an integer. how to solve it ...

help me please

Same error here

revrr commented 4 years ago

downgrade numpy to 1.16

firasbenyounes commented 4 years ago

@revrr solution worked for me just do pip install numpy==1.16

IamSierraCharlie commented 4 years ago

1.17.1 seems to work also - at least it does for me

FYI to anyone whos having issues with packages. Here is my list of install packages which is currently working for me with Anaconda `# packages in environment at C:\Users\steve\Anaconda3\envs\tensorflow_gpu: #

Name Version Build Channel

absl-py 0.9.0 pypi_0 pypi astor 0.8.1 pypi_0 pypi attrs 19.3.0 py_0 conda-forge backcall 0.1.0 py_0 conda-forge blas 1.0 mkl
bleach 3.1.5 pyh9f0ad1d_0 conda-forge ca-certificates 2020.4.5.1 hecc5488_0 conda-forge certifi 2020.4.5.1 py37hc8dfbb8_0 conda-forge colorama 0.4.3 py_0 conda-forge cycler 0.10.0 py_2 conda-forge cython 0.29.17 py37h1834ac0_0 conda-forge decorator 4.4.2 py_0 conda-forge defusedxml 0.6.0 py_0 conda-forge entrypoints 0.3 py37hc8dfbb8_1001 conda-forge freetype 2.10.1 ha9979f8_0 conda-forge gast 0.3.3 pypi_0 pypi google-pasta 0.2.0 pypi_0 pypi grpcio 1.28.1 pypi_0 pypi h5py 2.10.0 pypi_0 pypi hdf5 1.8.20 hac2f561_1
icc_rt 2019.0.0 h0cc432a_1
icu 64.2 he025d50_1 conda-forge importlib-metadata 1.6.0 py37hc8dfbb8_0 conda-forge importlib_metadata 1.6.0 0 conda-forge intel-openmp 2020.0 166
ipykernel 5.2.1 py37h5ca1d4c_0 conda-forge ipython 7.14.0 py37hc8dfbb8_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.5.1 py_0 conda-forge jedi 0.17.0 py37hc8dfbb8_0 conda-forge jinja2 2.11.2 pyh9f0ad1d_0 conda-forge jpeg 9c hfa6e2cd_1001 conda-forge jsonschema 3.2.0 py37hc8dfbb8_1 conda-forge jupyter 1.0.0 py_2 conda-forge jupyter_client 6.1.3 py_0 conda-forge jupyter_console 6.1.0 py_1 conda-forge jupyter_core 4.6.3 py37hc8dfbb8_1 conda-forge keras-applications 1.0.8 pypi_0 pypi keras-preprocessing 1.1.0 pypi_0 pypi kiwisolver 1.2.0 py37heaa310e_0 conda-forge libblas 3.8.0 15_mkl conda-forge libcblas 3.8.0 15_mkl conda-forge libclang 9.0.1 default_hf44288c_0 conda-forge libiconv 1.15 hfa6e2cd_1006 conda-forge liblapack 3.8.0 15_mkl conda-forge libopencv 3.4.2 h20b85fd_0
libpng 1.6.37 hfe6a214_1 conda-forge libsodium 1.0.17 h2fa13f4_0 conda-forge libtiff 4.1.0 h885aae3_6 conda-forge libxml2 2.9.10 h9ce36c8_0 conda-forge libxslt 1.1.33 heafd4d3_0 conda-forge lxml 4.4.1 py37heafd4d3_0 conda-forge lz4-c 1.9.2 h62dcd97_1 conda-forge m2w64-gcc-libgfortran 5.3.0 6
m2w64-gcc-libs 5.3.0 7
m2w64-gcc-libs-core 5.3.0 7
m2w64-gmp 6.1.0 2
m2w64-libwinpthread-git 5.0.0.4634.697f757 2
markdown 3.2.2 pypi_0 pypi markupsafe 1.1.1 py37h8055547_1 conda-forge matplotlib 3.1.1 py37_2 conda-forge matplotlib-base 3.1.1 py37h2981e6d_2 conda-forge mistune 0.8.4 py37h8055547_1001 conda-forge mkl 2020.0 166
mkl-service 2.3.0 py37hb782905_0
mkl_fft 1.0.15 py37h14836fe_0
mkl_random 1.1.1 py37h3bbf574_0 conda-forge msys2-conda-epoch 20160418 1
nbconvert 5.6.1 py37hc8dfbb8_1 conda-forge nbformat 5.0.6 py_0 conda-forge notebook 6.0.3 py37hc8dfbb8_0 conda-forge numpy 1.17.1 py37hc71023c_0 conda-forge numpy-base 1.17.4 py37hc3f5095_0
olefile 0.46 py_0 conda-forge opencv 3.4.2 py37h40b0b35_0
openssl 1.1.1g he774522_0 conda-forge packaging 20.1 py_0 conda-forge pandas 1.0.3 py37h3bbf574_1 conda-forge pandoc 2.9.2.1 0 conda-forge pandocfilters 1.4.2 py_1 conda-forge parso 0.7.0 pyh9f0ad1d_0 conda-forge pathlib 1.0.1 py37hc8dfbb8_2 conda-forge pickleshare 0.7.5 py37hc8dfbb8_1001 conda-forge pillow 6.2.1 py37h5fcff3f_1 conda-forge pip 20.1 pyh9f0ad1d_0 conda-forge prometheus_client 0.7.1 py_0 conda-forge prompt-toolkit 3.0.5 py_0 conda-forge prompt_toolkit 3.0.5 0 conda-forge protobuf 3.11.3 pypi_0 pypi py-opencv 3.4.2 py37hc319ecb_0
pycocotools 2.0 pypi_0 pypi pygments 2.6.1 py_0 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyqt 5.12.3 py37h1834ac0_3 conda-forge pyqt5-sip 4.19.18 pypi_0 pypi pyqtchart 5.12 pypi_0 pypi pyqtwebengine 5.12.1 pypi_0 pypi pyrsistent 0.16.0 py37h8055547_0 conda-forge python 3.7.6 h60c2a47_5_cpython conda-forge python-dateutil 2.8.1 py_0 conda-forge python_abi 3.7 1_cp37m conda-forge pytz 2020.1 pyh9f0ad1d_0 conda-forge pywin32 227 py37hfa6e2cd_0 conda-forge pywinpty 0.5.7 py37_0 conda-forge pyzmq 19.0.1 py37h453f00a_0 conda-forge qt 5.12.5 h7ef1ec2_0 conda-forge qtconsole 4.7.3 pyh9f0ad1d_0 conda-forge qtpy 1.9.0 py_0 conda-forge send2trash 1.5.0 py_0 conda-forge setuptools 46.1.3 py37hc8dfbb8_0 conda-forge six 1.14.0 py_1 conda-forge sqlite 3.30.1 hfa6e2cd_0 conda-forge tensorboard 1.14.0 pypi_0 pypi tensorflow-estimator 1.14.0 pypi_0 pypi tensorflow-gpu 1.14.0 pypi_0 pypi termcolor 1.1.0 pypi_0 pypi terminado 0.8.3 py37hc8dfbb8_1 conda-forge testpath 0.4.4 py_0 conda-forge tk 8.6.10 hfa6e2cd_0 conda-forge tornado 6.0.4 py37hfa6e2cd_0 conda-forge traitlets 4.3.3 py37hc8dfbb8_1 conda-forge vc 14.1 h869be7e_1 conda-forge vs2015_runtime 14.16.27012 h30e32a0_2 conda-forge wcwidth 0.1.9 pyh9f0ad1d_0 conda-forge webencodings 0.5.1 py_1 conda-forge werkzeug 1.0.1 pypi_0 pypi wheel 0.34.2 py_1 conda-forge widgetsnbextension 3.5.1 py37_0 conda-forge wincertstore 0.2 py37_1003 conda-forge winpty 0.4.3 4 conda-forge wrapt 1.12.1 pypi_0 pypi xz 5.2.5 h2fa13f4_0 conda-forge zeromq 4.3.2 h6538335_2 conda-forge zipp 3.1.0 py_0 conda-forge zlib 1.2.11 h2fa13f4_1006 conda-forge zstd 1.4.4 h9f78265_3 conda-forge `

It worth noting that the documentation does in fact ask for numpy 1.18.

rajatvisitme commented 4 years ago

@revrr solution worked for me just do pip install numpy==1.16

Even this is working... pip install update numpy==1.17.4

y9luiz commented 4 years ago

@EnricoBeltramo Was stuck with the same issue for a long time. I fixed it by downgrading to numpy 1.17.4. This works with tensorflow 1.15.2. Check out https://stackoverflow.com/questions/54099081/how-to-fix-numpy-float64-object-cannot-be-interpreted-as-an-integer.

%tensorflow_version 1.x
import tensorflow as tf
print(tf.__version__)
!pip install numpy==1.17.4

Hope that works for you as well!

works pretty well, thanks!

MattVoge commented 3 years ago

I am running into the same error. Unfortunately, downgrading numpy to 1.17.4, 1.16, or even older leads to multiple other errors. I am using Tensorflow 2.3.1. Has anybody a solution for TF 2?

kersm commented 3 years ago

I am running into the same error. Unfortunately, downgrading numpy to 1.17.4, 1.16, or even older leads to multiple other errors. I am using Tensorflow 2.3.1. Has anybody a solution for TF 2?

Hi Matt, did you find a solution. I'm experiencing also this problem with tensorflow. Downgrading Numpy gives other problems and upgrading to tensorflow 2.4 is also not possible because of CUDA Version...

br Martin

MattVoge commented 3 years ago

Hi Matt, did you find a solution. I'm experiencing also this problem with tensorflow. Downgrading Numpy gives other problems and upgrading to tensorflow 2.4 is also not possible because of CUDA Version...

Hi Martin, in my case it helped to uninstall pandas and numpy, then re-install numpy 1.18.5 and pandas 1.1.5. But I'm not sure if this workaround is good for other use cases, too...

kersm commented 3 years ago

Thanks Matt, your answer got me thinking in the right direction. I could solve this by changing the pycocotools version from 2.0.0 to 2.0.1

Mayson12381 commented 3 years ago

Thanks Matt, your answer got me thinking in the right direction. I could solve this by changing the pycocotools version from 2.0.0 to 2.0.1

Yes, this also helped me. Used this link for the upgrade to 2.0.2 https://www.programmersought.com/article/90096742523/

Zourunzhong commented 3 years ago

@Mayson12381 after the python setup.py build_ext --inplace python setup.py build_ext install

it only appears for the first conda list call image

calling conda list again will show pycoco is back to 2.0, same for pip list image

kch3coo commented 2 years ago

For those who doesn't want to or can't modify pycocotool and numpy versions, A quick fix is to go into the "/home/username/.local/lib/python3.6/site-packages/numpy/core/function_base.py", on line 120 and modify image into image

You can find this file in the error log, just click into the function_base.py and modify it.

Rob12312368 commented 2 years ago

@kch3coo life-saver, but is that the right way to handle this issue? I am having this question, since I do not know the way numpy handle this.

gitnasr commented 2 years ago

For those who doesn't want to or can't modify pycocotool and numpy versions, A quick fix is to go into the "/home/username/.local/lib/python3.6/site-packages/numpy/core/function_base.py", on line 120 and modify image into image

You can find this file in the error log, just click into the function_base.py and modify it.

That's better than downgrading ✔👌