tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)

报错信息:

Using TensorFlow backend.
WARNING:tensorflow:From /root/anaconda3/envs/pytf36/lib/python3.7/site-packages/tensorflow_core/python/compat/v2_compat.py:65: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term
2020-06-17 12:07:52.851581: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2
2020-06-17 12:07:52.864013: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2000000000 Hz
2020-06-17 12:07:52.864961: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x559052a5f750 executing computations on platform Host. Devices:
2020-06-17 12:07:52.865010: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): Host, Default Version
2020-06-17 12:07:52.867420: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2020-06-17 12:07:52.867459: E tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303)
2020-06-17 12:07:52.867512: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (localhost.localdomain): /proc/driver/nvidia/version does not exist
/root/anaconda3/envs/pytf36/lib/python3.7/site-packages/classification_models/resnext/__init__.py:4: UserWarning: Current ResNext models are deprecated, use keras.applications ResNeXt models
  warnings.warn('Current ResNext models are deprecated, '
WARNING:tensorflow:From /root/anaconda3/envs/pytf36/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3446: calling dropout (from tensorflow.python.ops.nn_ops) with keep_prob is deprecated and will be removed in a future version.
Instructions for updating:
Please use `rate` instead of `keep_prob`. Rate should be set to `rate = 1 - keep_prob`.
/root/anaconda3/envs/pytf36/lib/python3.7/site-packages/keras/engine/saving.py:292: UserWarning: No training configuration found in save file: the model was *not* compiled. Compile it manually.
  warnings.warn('No training configuration found in save file: '

 

 

原因:很可能是你安装了cpu版本和gpu版本的tensorflow,而你当前服务器没有GPU硬件,所以需要卸载掉gpu版本:

conda uninstall tensorflow-gpu

 

你可能感兴趣的:(tensorflow/stream_executor/cuda/cuda_driver.cc:318] failed call to cuInit: UNKNOWN ERROR (303))