christianpayer / MedicalDataAugmentationTool-VerSe

GNU General Public License v3.0
175 stars 81 forks source link

InvalidArgumentError: Conv3DBackpropInputOpV2 only supports NDHWC on the CPU. #7

Closed SniperM99 closed 3 years ago

SniperM99 commented 4 years ago

when i run main_spine_localization.py file. I get the simgle import error:

InvalidArgumentError: Conv3DBackpropInputOpV2 only supports NDHWC on the CPU.

Any help is highly appreciated.

christianpayer commented 4 years ago

It seems that you are using tensorflow with CPU, but have set the data_format to channels_first. This is not supported on the CPU. However, I would not recommend to use the CPU for training. You should make sure, that tensorflow is running on the GPU (see https://www.tensorflow.org/install/gpu).

leihouyeung commented 3 years ago

@christianpayer I had the same issue. I have already installed tensorflow-gpu 1.15.0. But the error was still there. How to fix it? Thanks!

christianpayer commented 3 years ago

If you encounter this problem, make sure that TF is actually using the GPU (see https://www.tensorflow.org/guide/gpu). Just installing tensorflow-gpu does not ensure that. If some libraries are missing for tensorflow-gpu, or there are some problems with CUDA, tensorflow-gpu will fallback to use the CPU only. Look at the warnings or error messages that are written out by tensorflow during initialization.