Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Error: tensorflow.python.framework.errors_impl.InvalidArgumentError #2

Closed
thevishalchauhan opened this issue Sep 7, 2021 · 1 comment
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@thevishalchauhan
Copy link

thevishalchauhan commented Sep 7, 2021

Traceback (most recent call last):
File "predict_video.py", line 107, in
X = np.rollaxis(X, 2, 0);print(m.predict( np.array([X])))
File "\anaconda3\envs\Q\lib\site-packages\tensorflow\python\keras\engine\training.py", line 1727, in predict
tmp_batch_outputs = self.predict_function(iterator)
File "anaconda3\envs\Q\lib\site-packages\tensorflow\python\eager\def_function.py", line 889, in call
result = self._call(*args, **kwds)
File "\anaconda3\envs\Q\lib\site-packages\tensorflow\python\eager\def_function.py", line 956, in _call
return self._concrete_stateful_fn._call_flat(
File "\anaconda3\envs\Q\lib\site-packages\tensorflow\python\eager\function.py", line 1960, in _call_flat
return self._build_call_outputs(self._inference_function.call(
File "\anaconda3\envs\Q\lib\site-packages\tensorflow\python\eager\function.py", line 591, in call
outputs = execute.execute(
File "anaconda3\envs\Q\lib\site-packages\tensorflow\python\eager\execute.py", line 59, in quick_execute
tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.InvalidArgumentError: Default MaxPoolingOp only supports NHWC on device type CPU
[[node model_1/max_pooling2d/MaxPool (defined at predict_video.py:107) ]] [Op:__inference_predict_function_1776]

Function call stack:
predict_function

@shukkkur
Copy link
Member

shukkkur commented Sep 7, 2021

@vishal0143 Hi there! My guess is you are executing the code on your local machine and it seems you're trying to run on CPU which is not supported by Tensorflow.
If your machine does not support GPU, try running the code on Google Colab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants