module mxnet has no attribute nd - pip

I am trying to use gluonts library. I installed gluonts 0.12.2 and when I try to import gluonts it says 'module mxnet has no attribute nd'. mxnet was installed by dependence with version 1.6.0. I am using macos, m1 pro. how can I solve this problem?
I tried to install mxnet from github repo and without dependence install, tried to install from pip with "pip install -U mxnet". they did not work.

Related

Unable to install coremltools

I am trying to convert a pb file to a coreml file. to do this i need to install coremltools. However, when i try to install it by pip it comes up with this error :
ERROR: Could not find a version that satisfies the requirement coremltools (from versions: none)
ERROR: No matching distribution found for coremltools
i have tried to install it in a python 2.7 environment, still no joy
pip install coremltools
Collecting coremltools
ERROR: Could not find a version that satisfies the requirement coremltools (from versions: none)
ERROR: No matching distribution found for coremltools
Rorys-MBP:~ roryhodgson$
The only reason I could found out that explains why this is happening is that coremltools require python 2.7, make sure you are running it pip --version. If you just typed pip install coremltools the chances are that your machine (assuming it is running macOS) pip command is running the default version of macOS python which probably is 3.5.2 or greater.
I could fix this issue by creating an environment in which my python version was 2.7:
pip install virtualenv
Create a virtual environment:
virtualenv --python=/usr/bin/python2.7 py27
Activate it:
source py27/bin/activate
Lastly, install coremltools:
pip install -U coremltools
When you are done just deactivate the environment running deactivate in the terminal and that's it.
All this is available at the following source: satoshi.blogs.com
If you install from GitHub, then you will not need to install Python 2.7 or fiddle with virtual environments.
pip install "git+https://github.com/apple/coremltools"
The code above will let you install coremltools by cloning the Git repository.

pip search showed apache-beam 2.9 but pip install apache-beam only get apache-beam2.2 installed

In my fresh new virtual environment.
I run
pip search apache-beam
I got
apache-beam (2.9.0)
Then I run
pip install apache-beam
pip list
But I got apache-beam 2.2 installed, instead of 2.9
apache-beam 2.2.0
I then run
python -m apache_beam.examples.wordcount --output cout
I got the error
The Apache Beam SDK for Python is supported only on Python 2.7.
From this document
https://towardsdatascience.com/hands-on-apache-beam-building-data-pipelines-in-python-6548898b66a5
beam 2.9 will support python3. But pip search I found apache-beam 2.9. but pip install, I still get apache-beam 2.2.
Please help.
I got the same kind of requirement, I tried this way to install apache Beam
it was worked for me.
Step 01: Make sure to install python 3.7 or above
Step 02: Beam version, I choose 2.27 for my requirement
pip3 install apache-beam==2.27.0

How to install AutoKeras on aws-ec2

I tried to install autokeras on aws ec2 (p2.xlarge) with the environment python 3.6 & tensorflow. I get following error after "pip install autokeras":
tensorflow 1.10.0 has requirement numpy<=1.14.5,>=1.13.3, but you'll have numpy 1.15.4 which is incompatible.
Installing collected packages: imageio, autokeras
Found existing installation: imageio 2.3.0
Cannot uninstall 'imageio'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
I uninstalled numpy 1.15.4 and installed numpy 1.14.5. With "conda list", I can see the numpy has the correct version.
But after "pip install autokeras" I get the same error and numpy 1.15.4 is still there.
Has anyone successfully installed autokeras on aws ec2? What shall I do to install autokeras correctly?
(Maybe the 'imageio' is the next problem?)
Thank you!
I think you need tensorflow 1.14. Here my notes for AutoKeras installation:
Autokeras Installation Notes in the Deep Learning AMI:
We launched a new deep learning AMI with ubuntu.
The deep learning AMI didn't worked using the "tensorflow + keras + py3.6" environment (so no need for a DL AMI probably, you can save space on disk using a normal clean AMI), so we managed o install autokeras doing the following:
Create a new environment with Anaconda: $ conda create -n autokeras python=3.6.
1.1. Remember that only python 3.6 is working with autokeras
Activate virtual env: It didn't work $ conda activate autokeras, but it works using $ source activate autokeras.
installation of all the packages as required by pyimagesearch.
3.1. A new problem arised here, which, long story short, was solved using the next post (note that I chenged the order, since urllib3 needs jsonschema to be installed first):
$ pip uninstall urllib3```
$ pip uninstall jsonschema
$ pip install jsonschema==2.6.0
$ pip install urllib3==1.24.1
3.2. Finally I was able to install all 3 packages:
$ pip install tensorflow # or tensorflow-gpu
$ pip install keras
$ pip install autokeras
3.3. Autokeras worked fine at this point, but it raised a warning:
>>> import autokeras
Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex
So I just went to the webpage and followed the installation steps. Now it works without warnings (so far):
$ git clone https://github.com/NVIDIA/apex
$ cd apex
$ pip install -v --no-cache-dir --global-option="--pyprof" --global-option="--cpp_ext" --global-option="--cuda_ext" ./

Installing tensorflow on anaconda/mac?

I can not find a solution to install tensorflow on anaconda/mac.
When i try: conda install tensorflow,
I get:
UnsatisfiableError: The following specifications were found to be in conflict:
- blaze -> numba -> numpy=1.13
- tensorflow
Use "conda info " to see the dependencies for each package.
I tried reinstalling numpy, and could not find any relevant documentation.
On mac use following command:
conda install -c conda-forge tensorflow
This will install the latest Tensorflow on your system. if you wish to upgrade it to newer version then you can use the following command
conda update -f -c conda-forge tensorflow
I have had success installing tensorflow through pip...
pip install tensorflow
or, if you have all of the proper libraries...
pip install tensorflow-gpu
But if you have already removed numpy form the anaconda install, you might be in for a long day because almost all of the numeric packages require it. If the above pip install doesn't work, you might want to start from a clean anaconda install.
I have installed tensorflow using -
pip install tensorflow
Or, you can use Anaconda in following way -
Open Anaconda Navigator
On Left side go to Environments
Create a new environment (eg :- tensorflow_tf), select python 3.7
then select Not installed and Search "tensorflow"
click on tensorflow and apply

how to install opencv and run first program in anaconda3 5.0.0 python 3.6.2 version?

I tried using
pip install opencv-python
It says to not break the installation rules and that I should use the conda command. How to install opencv and run first program on it in anaconda3 5.0.0 and python 3.6.2?
Ideall you shouldn't mix conda installed and pip installed packages - it confuses the dependencies when it comes to updates. Although you can use pip install opencv-python and opencv will work perfectly well within anaconda.
Instead you need to select opencv3 (assuming you want v3) from a specific repository
conda install -c menpo opencv3
ps. I don't know why it isn't included as standard and why have to know/search for the specific repository!

Resources