Comments (8)
As @tfboyd stated, you must use --data_format=NHWC when running on the CPU. You should also use --device=cpu, as @tfboyd stated.
@zheng-xq, why do we use soft placement? It makes the error message very unclear. We should give a better error message if tf_cnn_benchmarks is run on a machine without a GPU and --device=cpu is not specified.
from benchmarks.
nonetheless of all the aforementioned methods worked with me. I have this error when trying to execute general CNN modal of 4 classes:
Training
hist = model.fit(X_train, y_train, batch_size=16, epochs=num_epoch, verbose=1, validation_data=(X_test, y_test))
The is the displayed error:
InvalidArgumentError: Default MaxPoolingOp only supports NHWC on device type CPU
[[{{node max_pooling2d_2/MaxPool}}]]
I need any assistance to exceed this issue.
from benchmarks.
Unrelated to if this has been fixed. This is kind of a drive by comment. Sharing facts I believe I know for sure without research into what I do not know.
If you are using CPU-only I suggest building from source and using MKL. Here are some compelling stats. I realized building from source is a lot more work than downloading the binary. We are working on optimized builds. I know MKL supports this because I did the testing. Also you can just flip the data_format to NHWC and this works fine and for CPU is what you want unless using MKL.
You will also want to pass --device=cpu if you are using cpu only, due to soft placement it might just work anyway. There are also some MKL flags you could use if you use MKL those are in the link below as well.
NHWC was the data format of choice for CPU so many ops on CPU are not supported with the NCHW data_format. MKL (added by Intel and works fine on AMD, we tested) prefers NCHW and thus most operaitons are supported especially those related to CNNs as that is where they focused their time.
https://www.tensorflow.org/performance/performance_guide#tensorflow_with_intel_mkl_dnn
from benchmarks.
@tfboyd @reedwm
Thank you!
--device=cpu --data_format=NHWC
works for me.
I would suggest that --device=cpu --data_format=NHWC
should be the default when --num_gpus
option is 0 or is not there.
from benchmarks.
@reedwm I doubt XQ will answer here. :-) We should ask him though as having that on by default might be more trouble than the value (and I do not know the value for our script).
from benchmarks.
nonetheless of all the aforementioned methods worked with me. I have this error when trying to execute general CNN modal of 4 classes:
Training
hist = model.fit(X_train, y_train, batch_size=16, epochs=num_epoch, verbose=1, validation_data=(X_test, y_test))
The is the displayed error:
InvalidArgumentError: Default MaxPoolingOp only supports NHWC on device type CPU
[[{{node max_pooling2d_2/MaxPool}}]]
I need any assistance to exceed this issue.
Did you ever end up solving this issue?
from benchmarks.
Unrelated to if this has been fixed. This is kind of a drive by comment. Sharing facts I believe I know for sure without research into what I do not know.
If you are using CPU-only I suggest building from source and using MKL. Here are some compelling stats. I realized building from source is a lot more work than downloading the binary. We are working on optimized builds. I know MKL supports this because I did the testing. Also you can just flip the data_format to NHWC and this works fine and for CPU is what you want unless using MKL.
You will also want to pass --device=cpu if you are using cpu only, due to soft placement it might just work anyway. There are also some MKL flags you could use if you use MKL those are in the link below as well.
NHWC was the data format of choice for CPU so many ops on CPU are not supported with the NCHW data_format. MKL (added by Intel and works fine on AMD, we tested) prefers NCHW and thus most operaitons are supported especially those related to CNNs as that is where they focused their time.
https://www.tensorflow.org/performance/performance_guide#tensorflow_with_intel_mkl_dnn
excuse me, I meet the same error when inference with tensorflow1.10 C++ API, How should I solved this?
How to use --device=cpu --data_format=NHWC
in C++?
from benchmarks.
nonetheless of all the aforementioned methods worked with me. I have this error when trying to execute general CNN modal of 4 classes:
Training
hist = model.fit(X_train, y_train, batch_size=16, epochs=num_epoch, verbose=1, validation_data=(X_test, y_test))
The is the displayed error: InvalidArgumentError: Default MaxPoolingOp only supports NHWC on device type CPU [[{{node max_pooling2d_2/MaxPool}}]] I need any assistance to exceed this issue.
You can change your import to the below mentioned line
from keras import backend as K
K.set_image_data_format('channels_first ')
to
from keras import backend as K
K.set_image_data_format('channels_last ')
from benchmarks.
Related Issues (20)
- How do I get TF2.0 benchmark. HOT 1
- Impossible to test perfzero without docker HOT 2
- not using GCE instance HOT 2
- NotFoundError: No CPU devices are available in this process HOT 1
- Failure when running models with tf_cnn_benchmarks (threadpool in preprocessing.py) HOT 1
- ImportError: cannot import name multi_device_iterator_ops HOT 1
- OP_REQUIRES failed at save_restore_v2_ops.cc:205 : Not found: Key grouping/TCN/res_0_1/layer_normalization_1/beta not found in checkpoint
- TypeError: visualize_boxes_and_labels_on_image_array() missing 1 required positional argument: 'category_index'
- The accuracy of the program running by horovod is low
- resnet50 --use_fp16 error: cuDNN launch failure : input shape ([128,112,112,64])
- Perfzero support for Openshift on RHEL
- How to evaluate worker performance independently on a distributed training
- Alternative/current state of tf_cnn_benchmark HOT 3
- perfzero resnet benchmark is outdated HOT 3
- PerfZero Dataset for RetinaNet is not Avaiable HOT 1
- 4090 multi gpu not support
- What to use as replacement for tf_cnn_benchmark in the official tensorflow models HOT 2
- Docker 22.04 ubuntu and 12.1 cuda? HOT 1
- VariableV1 does not exist in /tensorflow/python/ops/variables.py HOT 2
- ImportError: cannot import name 'variable_v1' from 'tensorflow.python.ops' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from benchmarks.