6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Tensowflow "Could not load dynamic libary 'cudart64_110.dll'; dlerror: cudart64_110.dll not found

Last updated at Posted at 2021-01-26

#上記のエラーが出たときの対処法

解発環境
OS: Windows 10
ターミナル: Anaconda Prompt(Anaconda 同梱)

大まかな手順

  • CUDA Toolkitのインストール
  • ターミナルを閉じて再度開く
  • ターミナルでテストコードを再実行

CUDA Toolkitのインストール

CUDA Toolkit 11.2 DownloadsからCUDA Toolkitというのをダウンロードします。(自身の環境に合わせて選択して下さい。)
cuda download.png

ダウンロードしたら次は、インストールします。
image.png

image.png

image.png

image.png

image.png

image.png

image.png

インストールが終わったら、起動せずに閉じて大丈夫です。
image.png

Anaconda Promptは一度閉じて、再度開きます。

テストコードを再実行

anaconda-prompt
(t3.8) C:\Users\owner>python
>>>import tensorflow as tf
>>>mnist = tf.keras.datasets.mnist
>>>
>>>(x_train, y_train),(x_test, y_test) = mnist.load_data()
>>>x_train, x_test = x_train / 255.0, x_test / 255.0
>>>
>>>model = tf.keras.models.Sequential([
>>>  tf.keras.layers.Flatten(input_shape=(28, 28)),
>>>  tf.keras.layers.Dense(128, activation='relu'),
>>>  tf.keras.layers.Dropout(0.2),
>>>  tf.keras.layers.Dense(10, activation='softmax')
>>>])
>>>
>>>model.compile(optimizer='adam',
>>>              loss='sparse_categorical_crossentropy',
>>>              metrics=['accuracy'])
>>>
>>>model.fit(x_train, y_train, epochs=5)
>>>model.evaluate(x_test, y_test)

(実行結果)

anaconda-prompt
2021-01-26 20:47:14.909869: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2)
Epoch 1/5
.
~(途中省略)~
.
1875/1875 [==============================] - 1s 789us/step - loss: 0.0743 - accuracy: 0.9760

これで、実行に成功しました。

参考ページ: How to fix TensorFlow warning: Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found

6
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?