質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Chainer

Chainerは、国産の深層学習フレームワークです。あらゆるニューラルネットワークをPythonで柔軟に書くことができ、学習させることが可能。GPUをサポートしており、複数のGPUを用いた学習も直感的に記述できます。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Q&A

解決済

1回答

10113閲覧

chainerのGPU処理ができない

canaria369

総合スコア25

Chainer

Chainerは、国産の深層学習フレームワークです。あらゆるニューラルネットワークをPythonで柔軟に書くことができ、学習させることが可能。GPUをサポートしており、複数のGPUを用いた学習も直感的に記述できます。

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

0グッド

0クリップ

投稿2018/06/25 02:27

状況

下記URLの「Windowsでのインストール」以降を参考にしました。
https://www.sejuku.net/blog/42488

CPUでの動作は確認できましたが、GPUでは動作しません。
解決方法をご存知であればご教示願います。

エラー内容

C:\Users\Administor>python C:\Users\Administor\Documents\Chainer\trainer.py
Traceback (most recent call last):
File "C:\Users\Administor\Documents\Chainer\trainer.py", line 130, in <module>
cuda.get_device(gpu_device).use()
File "C:\Users\Administor\AppData\Local\Continuum\anaconda3\lib\site-packages\chainer\backends\cuda.py", line 223, in get_device
return _get_device(*args)
File "C:\Users\Administor\AppData\Local\Continuum\anaconda3\lib\site-packages\chainer\backends\cuda.py", line 229, in _get_device
check_cuda_available()
File "C:\Users\Administor\AppData\Local\Continuum\anaconda3\lib\site-packages\chainer\backends\cuda.py", line 90, in check_cuda_available
raise RuntimeError(msg)
RuntimeError: CUDA environment is not correctly set up
(see https://github.com/chainer/chainer#installation).CuPy is not correctly installed.

If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host.
Also, confirm that only one CuPy package is installed:
$ pip freeze

If you are building CuPy from source, please check your environment, uninstall CuPy and reinstall it with:
$ pip install cupy --no-cache-dir -vvvv

Check the Installation Guide for details:
https://docs-cupy.chainer.org/en/latest/install.html

original error: DLL load failed: 指定されたモジュールが見つかりません。

python

1gpu_device = 0 2cuda.get_device(gpu_device).use() # エラーの行(line:130) 3model.to_gpu(gpu_device) 4xp = cuda.cupy 5 6optimizer = optimizers.Adam() 7optimizer.setup(model)

環境

OS:Windows Server 2016 Essencial
GPU:NVIDIA GeForce GTX 1050 Ti

インストールしたものバージョン
Python3.6.5
ANACANDA5.2
CUDA9.2
パッケージバージョン
alabaster0.7.10
anaconda-client1.6.14
anaconda-navigator1.8.7
anaconda-project0.8.2
asn1crypto0.24.0
astroid1.6.3
astropy3.0.2
attrs18.1.0
Babel2.5.3
backcall0.1.0
backports.shutil-get-terminal-size1.0.0
beautifulsoup44.6.0
bitarray0.8.1
bkcharts0.2
blaze0.11.3
bleach2.1.3
bokeh0.12.16
boto2.48.0
Bottleneck1.2.1
certifi2018.4.16
cffi1.11.5
chainer4.1.0
chardet3.0.4
click6.7
cloudpickle0.5.3
clyent1.2.2
colorama0.3.9
comtypes1.1.4
conda4.5.4
conda-build3.10.5
conda-verify2.0.0
contextlib20.5.5
cryptography2.2.2
cupy-cuda925.0.0b2
cycler0.10.0
Cython0.28.2
cytoolz0.9.0.1
dask0.17.5
datashape0.5.4
decorator4.3.0
distributed1.21.8
docutils0.14
entrypoints0.2.3
et-xmlfile1.0.1
fastcache1.0.2
fastrlock0.3
filelock3.0.4
Flask1.0.2
Flask-Cors3.0.4
gevent1.3.0
glob20.6
greenlet0.4.13
h5py2.8.0
heapdict1.0.0
html5lib1.0.1
idna2.6
imageio2.3.0
imagesize1.0.0
ipykernel4.8.2
ipython6.4.0
ipython-genutils0.2.0
ipywidgets7.2.1
isort4.3.4
itsdangerous0.24
jdcal1.4
jedi0.12.0
Jinja22.10
jsonschema2.6.0
jupyter1.0.0
jupyter-client5.2.3
jupyter-console5.2.0
jupyter-core4.4.0
jupyterlab0.32.1
jupyterlab-launcher0.10.5
kiwisolver1.0.1
lazy-object-proxy1.3.1
llvmlite0.23.1
locket0.2.0
lxml4.2.1
MarkupSafe1.0
matplotlib2.2.2
mccabe0.6.1
menuinst1.4.14
mistune0.8.3
mkl-fft1.0.0
mkl-random1.0.1
more-itertools4.1.0
mpmath1.0.0
msgpack0.5.6
msgpack-python0.5.6
multipledispatch0.5.0
navigator-updater0.2.1
nbconvert5.3.1
nbformat4.4.0
networkx2.1
nltk3.3
nose1.3.7
notebook5.5.0
numba0.38.0
numexpr2.6.5
numpy1.14.5
numpydoc0.8.0
odo0.5.1
olefile0.45.1
openpyxl2.5.3
packaging17.1
pandas0.23.1
pandocfilters1.4.2
parso0.2.0
partd0.3.8
path.py11.0.1
pathlib22.3.2
patsy0.5.0
pep81.7.1
pickleshare0.7.4
Pillow5.1.0
pip10.0.1
pkginfo1.4.2
pluggy0.6.0
ply3.11
prompt-toolkit1.0.15
protobuf3.6.0
psutil5.4.5
py1.5.3
pycodestyle2.4.0
pycosat0.6.3
pycparser2.18
pycrypto2.6.1
pycurl7.43.0.1
pyflakes1.6.0
Pygments2.2.0
pylint1.8.4
pyodbc4.0.23
pyOpenSSL18.0.0
pyparsing2.2.0
PySocks1.6.8
pytest3.5.1
pytest-arraydiff0.2
pytest-astropy0.3.0
pytest-doctestplus0.1.3
pytest-openfiles0.3.0
pytest-remotedata0.2.1
python-dateutil2.7.3
pytz2018.4
PyWavelets0.5.2
pywin32223
pywinpty0.5.1
PyYAML3.12
pyzmq17.0.0
QtAwesome0.4.4
qtconsole4.3.1
QtPy1.4.1
requests2.18.4
rope0.10.7
ruamel-yaml0.15.35
scikit-image0.13.1
scikit-learn0.19.1
scipy1.1.0
seaborn0.8.1
Send2Trash1.5.0
setuptools39.2.0
simplegeneric0.8.1
singledispatch3.4.0.3
six1.11.0
snowballstemmer1.2.1
sortedcollections0.6.1
sortedcontainers1.5.10
Sphinx1.7.4
sphinxcontrib-websupport1.0.1
spyder3.2.8
SQLAlchemy1.2.7
statsmodels0.9.0
sympy1.1.1
tables3.4.3
tblib1.3.2
terminado0.8.1
testpath0.3.1
toolz0.9.0
tornado5.0.2
traitlets4.3.2
typing3.6.4
unicodecsv0.14.1
urllib31.22
wcwidth0.1.7
webencodings0.5.1
Werkzeug0.14.1
wheel0.31.1
widgetsnbextension3.2.1
win-inet-pton1.0.1
win-unicode-console0.5
wincertstore0.2
wrapt1.10.11
xlrd1.1.0
XlsxWriter1.0.4
xlwings0.11.8
xlwt1.3.0
zict0.1.3

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

RuntimeError: CUDA environment is not correctly set up
(直訳) CUDAの実行環境が正しく設定されていません

CuPy is not correctly installed.
(直訳) CuPyが正しくインストールされていません

If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host.
Also, confirm that only one CuPy package is installed:
(直訳) もし、wheel distribution (cupy-cudaXX)を使っているなら、ホスト上のCUDAのバージョンと、インストールしたCuPyのバージョンが合致していることを確認しましょう。
また、インストールされているCuPyのパッケージが一つであることも確認しましょう(複数のバージョンのCuPyがインストールされていたらトラブルが起きるという事)

と多くのエラーメッセージと、確認事項が出ていますから、順に確認して、問題があればインストールのし直しなどをしてください。

==
僕は、cupy-cuda92のバージョンの、5.0.0b2、に数字以外の文字"b"が使われているところが気になります。
というのは、ベータ版のバージョンに Bataのbを使うことがあるからです。

==
現在最新版は、cupy-cuda92 4.2.0 で、CUDA 4.2、、CUDA Toolkit 9.2 の環境で使う。

これら最新版で新たに環境を構築するのが問題解決の早道かもしれません。

投稿2018/06/25 04:23

coco_bauer

総合スコア6915

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

canaria369

2018/06/25 05:57

回答ありがとうございます. pip install cupy-cuda92==4.2.0で試したところ Could not find a version that satisfies the requirement というエラーが表示されてしまいました そのためgitから直接ダウンロードしてインストールを試みましたが また別のエラーが発生してしまいました 一度きれいさっぱりなくして初めからやり直してみます
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問