ArtLabss / tennis-tracking

Open-source Monocular Python HawkEye for Tennis
https://www.artlabs.tech
The Unlicense
392 stars 95 forks source link

google collab error Default MaxPoolingOp only supports NHWC on device type CPU [[{{node model_1/max_pooling2d/MaxPool}}]] [Op:__inference_predict_function_1782] #26

Closed cbutler99 closed 1 year ago

cbutler99 commented 1 year ago

Describe the bug running code on google collab due to GPU tensor flow issue on laptop

BIGGEST [1015. 626. 1083. 845.] Finished! Tracking the ball: 0.0 Traceback (most recent call last): File "predict_video.py", line 155, in pr = m.predict(np.array([X]))[0] File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 67, in error_handler raise e.with_traceback(filtered_tb) from None File "/usr/local/lib/python3.8/dist-packages/tensorflow/python/eager/execute.py", line 54, in quick_execute tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name, tensorflow.python.framework.errors_impl.InvalidArgumentError: Graph execution error:

Detected at node 'model_1/max_pooling2d/MaxPool' defined at (most recent call last): File "predict_video.py", line 155, in pr = m.predict(np.array([X]))[0] File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 64, in error_handler return fn(*args, kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 2033, in predict tmp_batch_outputs = self.predict_function(iterator) File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1845, in predict_function return step_function(self, iterator) File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1834, in step_function outputs = model.distribute_strategy.run(run_step, args=(data,)) File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1823, in run_step outputs = model.predict_step(data) File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 1791, in predict_step return self(x, training=False) File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 64, in error_handler return fn(*args, *kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/engine/training.py", line 490, in call return super().call(args, kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 64, in error_handler return fn(*args, kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/engine/base_layer.py", line 1014, in call outputs = call_fn(inputs, *args, *kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 92, in error_handler return fn(args, kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/engine/functional.py", line 458, in call return self._run_internal_graph( File "/usr/local/lib/python3.8/dist-packages/keras/engine/functional.py", line 596, in _run_internal_graph outputs = node.layer(*args, kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 64, in error_handler return fn(*args, *kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/engine/base_layer.py", line 1014, in call outputs = call_fn(inputs, args, kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/utils/traceback_utils.py", line 92, in error_handler return fn(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/layers/pooling/base_pooling2d.py", line 73, in call outputs = self.pool_function( Node: 'model_1/max_pooling2d/MaxPool' Default MaxPoolingOp only supports NHWC on device type CPU [[{{node model_1/max_pooling2d/MaxPool}}]] [Op:__inference_predict_function_1782]

shukkkur commented 1 year ago

@cbutler99 hopefully you solved the issue)

maisiukartyom commented 1 year ago

having this issue on my pc. How to solve this?

shukkkur commented 1 year ago

@maisiukartyom @cbutler99 Switch to GPU computing. Here, refer to this issue, exact problem https://github.com/ArtLabss/tennis-tracking/issues/2#issuecomment-914391586 :)

cbutler99 commented 1 year ago

It was the version of torch i was running. you need to install the gpu version.