I am trying to install this program in ubuntu terminal.
https://github.com/mlhubber/colorize
For this I executed these three lines of code:
pip3 install mlhub
ml install colorize
ml configure colorize
and when executing the last line I get this error message:
*** The following required system packages are already installed:
python3-numpy python3-pydot python3-matplotlib python3-opencv python3-graphviz python3-toolz
*** Installing Python package tensorflow-cpu by pip into
/root/.mlhub/colorize/.python
Do you want to pip install tensorflow-cpu [Y/n]?
And I select yes
Do you want to pip install tensorflow-cpu [Y/n]? Y
mlhub: An error was encountered:
Usage:
pip install [options] <requirement specifier> [package-index-options] ...
pip install [options] -r <requirements file> [package-index-options] ...
pip install [options] [-e] <vcs project url> ...
pip install [options] [-e] <local project path> ...
pip install [options] <archive url/path> ...
no such option: --no-warn-script-location
However when I select that I don't get the following output:
Do you want to pip install tensorflow-cpu [Y/n]? n
*** Installing Python package keras>=2.4.3 by pip into
/root/.mlhub/colorize/.python
Do you want to pip install keras>=2.4.3 [Y/n]? n
*** Downloading required files ...
* https://github.com/foamliu/Simple-Colorization/releases/download/v1.0/model.06-2.5489.hdf5
using cached copy found in /root/.mlhub/colorize/cache/models/model.06-2.5489.hdf5 ...
To view the model's README:
$ ml readme colorize
I select the photo I want to color and I get the following result:
(tensorflow) root@apl00028:/tmp# ml color colorize --interactive /mnt/c/Users/apl00.DESKTOP-IGEQ9D2/Downloads/Photo.jpeg Photo_color.jpeg
Traceback (most recent call last):
File "color.py", line 29, in <module>
from utils import get_predict_api, plot_bw_color_comparison
File "/root/.mlhub/colorize/utils.py", line 5, in <module>
import tensorflow as tf
ModuleNotFoundError: No module named 'tensorflow'
How can I fix this installation issue? Or how can I install a similar program to colorize photos?
Thanks in advance
I have tried to simulate this case in the same way so that I end up throwing the same error that you have:
What routes do you have set for python3 and for pip? Run the following commands:
Could it be that you have different routes established? It is most likely.
This is one of the reasons for working with virtual environments. More on virtual environments in the Python documentation
In fact, in the tensorflow.org guide, they recommend using virtual environment "Python virtual environments should be used to isolate package installation from the system":
Install tensorflow
You could try to create a virtual environment for this kind of thing and avoid problems with packages, imports, executions and associated paths.
Remove everything you installed for ml (mlhub, tensorflow, keras, etc. Depends on where your path points to )
Install virtualenv :
This way you can install packages without affecting the system. In fact, if you do a
type pip3
you can see that the route changes:It will ask you again to install tensorflow, keras, among others, but it will do so in the virtual environment.
In fact, we can see it by listing the content in the virtual environment:
Now we can do a test: