Installation

@Ali_coder
Recommend my post: Do these before you ask

You can try to google it before you ask. I’m a AMD user, but all Nvidia GPU support cuda in my mind.

If you use mxnet, go to https://mxnet.apache.org/versions/1.6/get_started/

You can use CPU version or CUDA version in your computer.
Or just use a server image


Or just google it:
Can I use MX 250 Graphic Card for basic Deep Learning ?

Then go to the nvidia website:


image
But you can’t find the CUDA download…

So you just search it, then you find mxnet doesn’t support cuda11 yet.


So you search for

You can select the right Platform for your cuda:

http://preview.d2l.ai/d2l-en/master/chapter_appendix-tools-for-deep-learning/aws.html#Installing%20CUDA

After you installed cuda 10.2 , you can install mxnet:
Example:


Give you an exercise:

  1. use google to install pytorch-gpu locally

Ha, I found an cute user. If you are Josiah Yoder, please tell me it’s ok to publish it

Dear All,
Problem with mxnet installation.
I have installed mxnet-cu101==1.7.0 on my ubuntu 18.04, GPU Geforce gtx 1660 Ti. Results show as follows.
Requirement already satisfied: idna<3,>=2.5 in ./anaconda3/envs/d2l/lib/python3.7/site-packages (from requests<3,>=2.20.0->mxnet-cu101==1.7.0) (2.10)
But when I import mxnext it showed errors as follows.

from mxnet import np, npx
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘mxnet’
Could anyone help me, please?
Thanks in advance.

Hi @Duong_PC, anaconda may be a bit tricky. Could you try with miniconda as https://d2l.ai/chapter_installation/index.html#installing-miniconda?

Thank you very much for the quick reply. May I install both anaconda and miniconda? In case I wanna keep using only anaconda, is there any solution for the tricky? Thanks.

You can use only anaconda.
Only need
conda install what you need
@Duong_PC

Help!

$ pip install mxnet==1.7.0
    ERROR: Could not find a version that satisfies the requirement mxnet==1.7.0 (from versions: 1.6.0, 1.7.0.post1)
    ERROR: No matching distribution found for mxnet==1.7.0

Hi @anish, sorry for the inconvenience. Please follow what the error message suggested:
pip install mxnet==1.7.0.post1

I am getting the error of “NotJSONError(“Notebook does not appear to be JSON: ‘’…”)”

Hi @aaekay, it may cause by git conflict or other jupyter issues, check here for potential solutions.

One easiest solution if you haven’t played with the notebooks yet: you can do a git reset --hard origin/master. While please be aware that will remove all the previous history you made to the notebooks, but update your local content as consistent as the origin/master.

Hi
I just switched to a new computer and surprisingly, cannot install mxnet 1.7.0.post1. Does anyone know why?

$ pip install mxnet==1.7.0.post1
ERROR: Could not find a version that satisfies the requirement mxnet==1.7.0.post1 (from versions: 0.11.0, 0.12.0, 0.12.1, 1.0.0, 1.0.0.post1, 1.0.0.post3, 1.0.0.post4, 1.1.0.post0, 1.2.0, 1.2.1, 1.2.1.post1, 1.3.0, 1.3.1, 1.4.0, 1.4.0.post0, 1.4.1, 1.5.0, 1.6.0)
ERROR: No matching distribution found for mxnet==1.7.0.post1

1 Like

I can’t yet. Issue already:https://github.com/apache/incubator-mxnet/issues/19594
@tdemunck

tried to install mxnet using
pip install mxnet==1.7.0.post1

I’m getting this error message:
ERROR: Command errored out with exit status 1:
command: ‘C:\Users\zhang\miniconda\python.exe’ -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"‘C:\Users\zhang\AppData\Local\Temp\pip-install-gbe7d_2e\numpy\setup.py’"’"’; file =’"’"‘C:\Users\zhang\AppData\Local\Temp\pip-install-gbe7d_2e\numpy\setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)( file );code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file , ‘"’"‘exec’"’"’))’ bdist_wheel -d ‘C:\Users\zhang\AppData\Local\Temp\pip-wheel-v5qdsit8’
cwd: C:\Users\zhang\AppData\Local\Temp\pip-install-gbe7d_2e\numpy
Complete output (264 lines):
Running from numpy source directory.
C:\Users\zhang\AppData\Local\Temp\pip-install-gbe7d_2e\numpy\numpy\distutils\misc_util.py:476: SyntaxWarning: “is” with a literal. Did you mean “==”?
return is_string(s) and (’*’ in s or ‘?’ is s)
blas_opt_info:
blas_mkl_info:
No module named ‘numpy.distutils._msvccompiler’ in numpy.distutils; trying from distutils
customize MSVCCompiler
libraries mkl_rt not found in [‘C:\Users\zhang\miniconda\lib’, ‘C:’, ‘C:\Users\zhang\miniconda\libs’]
NOT AVAILABLE

blis_info:
No module named ‘numpy.distutils._msvccompiler’ in numpy.distutils; trying from distutils
customize MSVCCompiler
libraries blis not found in [‘C:\Users\zhang\miniconda\lib’, ‘C:’, ‘C:\Users\zhang\miniconda\libs’]

Please, refer to https://stackoverflow.com/questions/65325177/how-to-solve-numpy-error-while-installing-mxnet.

"
It looks like you need a compiler installed as the package is trying to build some libraries from source. I’d suggest following the advice in this part of the error message, and see if that gets you any further… “”" No module named ‘numpy.distutils._msvccompiler’ in numpy.distutils; trying from distutils error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: visualstudio.microsoft.com/visual-cpp-build-tools “”" – [James McCorrie] [Dec 16 '20 at 15:22]
"

My problem same as yours was solved with installing “Microsoft C++ Build Tools”.

Hi. I am having trouble to let the plot (chapter 2.4.1) show up . The same problem as here: https://www.pyimagesearch.com/2015/08/24/resolved-matplotlib-figures-not-showing-up-or-displaying
When I try plain matplotlib without mxnet I see a plot. Does someone know how to fix that? Is there a way to tell the matplotlib in mxnet which backend to use? (is it using a different one than whithout mxnet?) I am using Debian and installed the dependencies with pip and I haven’t conda installed.

Hi, my computer can’t run GPU so i plan to install on Google Colab. Can I do that? If so, please guide me.

I’m on Windows 10, using Anaconda3. Installation of everything succeeded smoothly, but the package d2l cannot be imported.

Upon executing:
from d2l import mxnet as d2l

The kernel failed, and the Jupyter Notebook command prompt window prints:
Traceback (most recent call last):
File “C:\ProgramData\Anaconda3\envs\d2l\lib\runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “C:\ProgramData\Anaconda3\envs\d2l\lib\runpy.py”, line 87, in _run_code
exec(code, run_globals)
File “C:\ProgramData\Anaconda3\envs\d2l\lib\site-packages\ipykernel_launcher.py”, line 16, in
app.launch_new_instance()
File “C:\ProgramData\Anaconda3\envs\d2l\lib\site-packages\traitlets\config\application.py”, line 844, in launch_instance
app.initialize(argv)
File “C:\ProgramData\Anaconda3\envs\d2l\lib\site-packages\traitlets\config\application.py”, line 87, in inner
return method(app, *args, **kwargs)
File “C:\ProgramData\Anaconda3\envs\d2l\lib\site-packages\ipykernel\kernelapp.py”, line 570, in initialize
self.write_connection_file()
File “C:\ProgramData\Anaconda3\envs\d2l\lib\site-packages\ipykernel\kernelapp.py”, line 230, in write_connection_file
write_connection_file(cf, ip=self.ip, key=self.session.key, transport=self.transport,
File “C:\ProgramData\Anaconda3\envs\d2l\lib\site-packages\jupyter_client\connect.py”, line 138, in write_connection_file
with secure_write(fname) as f:
File “C:\ProgramData\Anaconda3\envs\d2l\lib\contextlib.py”, line 113, in enter
return next(self.gen)
File “C:\ProgramData\Anaconda3\envs\d2l\lib\site-packages\jupyter_core\paths.py”, line 461, in secure_write
win32_restrict_file_to_user(fname)
File “C:\ProgramData\Anaconda3\envs\d2l\lib\site-packages\jupyter_core\paths.py”, line 387, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed while importing win32api: The specified module could not be found.

[Update] I tried installing win32api with: conda install win32api (instead of pip). Now it works.

1 Like

Help!
I have installed mxnet-cu101==1.7.0, for mx250
I try a script ,but I found it have no io.ImageRecordIter(),why? below is my script for windows10
image

D:\virtualenv\Python36\Scripts\python.exe D:/MyPyCharmProject/neural_network_cnn_vehicle_identification/fine_tune_cars.py
[15:33:22] C:\Jenkins\workspace\mxnet-tag\mxnet\src\io\iter_image_recordio_2.cc:178: ImageRecordIOParser2: raid\datasets\cars\rec\train.rec, use 2 threads for decoding…
[15:33:22] C:\Jenkins\workspace\mxnet-tag\mxnet\src\base.cc:84: Upgrade advisory: this mxnet has been built against cuDNN lib version 7500, which is older than the oldest version tested by CI (7600). Set MXNET_CUDNN_LIB_CHECKING=0 to quiet this warning.
[15:33:27] C:\Jenkins\workspace\mxnet-tag\mxnet\src\io\iter_image_recordio_2.cc:178: ImageRecordIOParser2: raid\datasets\cars\rec\val.rec, use 3 threads for decoding…
[INFO] loading pre-trained model…
[15:33:27] C:\Jenkins\workspace\mxnet-tag\mxnet\src\nnvm\legacy_json_util.cc:209: Loading symbol saved by previous version v0.8.0. Attempting to upgrade…
[15:33:27] C:\Jenkins\workspace\mxnet-tag\mxnet\src\nnvm\legacy_json_util.cc:217: Symbol successfully upgraded!
[INFO] training network…
Traceback (most recent call last):
File “D:/MyPyCharmProject/neural_network_cnn_vehicle_identification/fine_tune_cars.py”, line 130, in
epoch_end_callback=epochEndCBs)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\module\base_module.py”, line 533, in fit
self.update_metric(eval_metric, data_batch.label)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\module\module.py”, line 775, in update_metric
self.exec_group.update_metric(eval_metric, labels, pre_sliced)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\module\executor_group.py”, line 648, in update_metric
eval_metric.update_dict(labels
, preds)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\metric.py”, line 348, in update_dict
metric.update_dict(labels, preds)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\metric.py”, line 132, in update_dict
self.update(label, pred)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\metric.py”, line 493, in update
pred_label = pred_label.asnumpy().astype(‘int32’)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\ndarray\ndarray.py”, line 2566, in asnumpy
ctypes.c_size_t(data.size)))
File “D:\virtualenv\Python36\lib\site-packages\mxnet\base.py”, line 246, in check_call
raise get_last_ffi_error()
mxnet.base.MXNetError: Traceback (most recent call last):
File “c:\jenkins\workspace\mxnet-tag\mxnet\src\storage./pooled_storage_manager.h”, line 161
MXNetError: cudaMalloc retry failed: out of memory

Process finished with exit code 1

Need help
I’m a novice in use mxnet.
resently,I install mxnet-cu101 on my computer (win10),I found these is no moudle ‘ImageRecordIter()’,I
want to know if new version mxnet has cut the function of .
I tried some kind of version (1.5, 1.6 ,1.7 ,2.0), having the same erro in my desktop(750ti gpu),laptop (mx250 gpu)
image
D:\virtualenv\Python36\Scripts\python.exe D:/MyPyCharmProject/neural_network_cnn_vehicle_identification/fine_tune_cars.py
[09:15:45] C:\Jenkins\workspace\mxnet\mxnet\src\io\iter_image_recordio_2.cc:179: ImageRecordIOParser2: raid\datasets\cars\rec\train.rec, use 2 threads for decoding…
[09:15:45] C:\Jenkins\workspace\mxnet\mxnet\src\base.cc:84: Upgrade advisory: this mxnet has been built against cuDNN lib version 7500, which is older than the oldest version tested by CI (7600). Set MXNET_CUDNN_LIB_CHECKING=0 to quiet this warning.
[09:15:51] C:\Jenkins\workspace\mxnet\mxnet\src\io\iter_image_recordio_2.cc:179: ImageRecordIOParser2: raid\datasets\cars\rec\val.rec, use 3 threads for decoding…
[INFO] loading pre-trained model…
[09:15:51] C:\Jenkins\workspace\mxnet\mxnet\src\nnvm\legacy_json_util.cc:209: Loading symbol saved by previous version v0.8.0. Attempting to upgrade…
[09:15:51] C:\Jenkins\workspace\mxnet\mxnet\src\nnvm\legacy_json_util.cc:217: Symbol successfully upgraded!
[INFO] training network…
Traceback (most recent call last):
File “D:\virtualenv\Python36\lib\site-packages\mxnet\symbol\symbol.py”, line 1833, in simple_bind
ctypes.byref(exe_handle)))
File “D:\virtualenv\Python36\lib\site-packages\mxnet\base.py”, line 246, in check_call
raise get_last_ffi_error()
mxnet.base.MXNetError: Traceback (most recent call last):
File “c:\jenkins\workspace\mxnet\mxnet\src\storage./pooled_storage_manager.h”, line 163
MXNetError: cudaMalloc retry failed: out of memory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “D:/MyPyCharmProject/neural_network_cnn_vehicle_identification/fine_tune_cars.py”, line 130, in
epoch_end_callback=epochEndCBs)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\module\base_module.py”, line 498, in fit
for_training=True, force_rebind=force_rebind)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\module\module.py”, line 429, in bind
state_names=self._state_names)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\module\executor_group.py”, line 280, in init
self.bind_exec(data_shapes, label_shapes, shared_group)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\module\executor_group.py”, line 384, in bind_exec
shared_group))
File “D:\virtualenv\Python36\lib\site-packages\mxnet\module\executor_group.py”, line 678, in _bind_ith_exec
shared_buffer=shared_data_arrays, **input_shapes)
File “D:\virtualenv\Python36\lib\site-packages\mxnet\symbol\symbol.py”, line 1839, in simple_bind
raise RuntimeError(error_msg)
RuntimeError: simple_bind error. Arguments:
data: (2, 3, 224, 224)
softmax_label: (2,)
Traceback (most recent call last):
File “c:\jenkins\workspace\mxnet\mxnet\src\storage./pooled_storage_manager.h”, line 163
MXNetError: cudaMalloc retry failed: out of memory

Process finished with exit code 1