How to Install Tensorflow on Google Coral Dev Board? - tensorflow

How to install Tensorflow on Coral Dev?
Getting errors following this on Coral Dev board (one of them):
    Error Message: compile.sh not found.
Please, give me some additional instruction, thanks.

It is really not going to be possible to help if you don't give details on what you've done or what errors you ran into while trying to install it.
However, since the objective is to install tensorflow on the board, you can just do this using this pre-built package:
$ wget https://github.com/lhelontra/tensorflow-on-arm/releases/download/v2.0.0/tensorflow-2.0.0-cp37-none-linux_aarch64.whl
$ sudo apt-get install -y python3-dev libhdf5-dev python3-h5py
$ sudo pip3 install tensorflow-2.0.0-cp37-none-linux_aarch64.whl
Also, please note that using the full tensorflow on the board isn't going to gain any performance from the TPU.
[Edit] Apologies, forgot to credit lhelontra/tensorflow-on-arm repo for the prebuilt package!

Related

lightgbm GPU install not working in Colab

I'm trying to install lightgbm with GPU support in colab, but every method I've tried ends up causing LightGBM to produce an error message stating that unexpected keyword arguments are being used (e.g., early_stopping_rounds) when I attempt to train the model. If I try it without including the kwarg that caused the error, it just returns the same error message for a different one that's still included. The code works totally fine when I run it with the pre-loaded version of lightgbm that is included in colab envs, but any attempt I've made to install the package with GPU support leads to this error if the installation is successful.
Any idea what I am doing wrong here?
Here's the most recent method I followed to install lgbm with gpu support enabled:
! git clone --recursive https://github.com/Microsoft/LightGBM
! cd LightGBM && rm -rf build && mkdir build && cd build && cmake -DUSE_GPU=1 ../../LightGBM && make -j4 && cd ../python-package && python3 setup.py install --precompile --gpu;
%cd /content/LightGBM/python-package
!python3 setup.py install --gpu
Any ideas why this might be happening?
Well, not entirely sure why, but it is working now. I installed following the instructions in this stack overflow question. Same as before, but only difference is I ran the colab notebook on my iMac instead of macbook. Not sure what difference that would make since my understanding is colab shouldn't be influenced by the local system, but alas, here we are.

opencv-python compiled fail in apple m1 chip

I installed Tensorflow-macos and try to install opencv-python
but always fail in this message
ERROR: Command errored out with exit status 1: /Users/sean/Documents/sysvenv/tf24v/bin/python3 /Users/sean/Documents/sysvenv/tf24v/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/gy/jzs3xnwd1z3203d75y_31nxc0000gn/T/pip-build-env-en64krht/overlay --no-warn-script-location -v --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel scikit-build cmake pip 'numpy==1.13.3; python_version=='"'"'3.6'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"'' 'numpy==1.19.3; python_version>='"'"'3.9'"'"'' Check the logs for full command output.
it lookalike the bumpy version problem.
But In Tensorflow-macos it it 1.8.5 and python is 3.8
Does anynoe have the same problem?
thanks
You might want to look at these suggestions:
opencv issues with M1 MAC - OpenCV imshow doesnot work
conda install opencv
I was successful in installing Python 3.9.1 for Apple Silicon and then running conda install opencv. However, the slow time to compute a few functions for the first time might suggest some components are still being translated via Rosetta. Regardless, while I did not test performance the functions I needed seemed to work.
after searching the web I have successfully installed OpenCV on my Mac M1.
Probably you don't have brew installed, so here's how you should install it:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install wget
brew install miniforge
brew install cmake, you will need cmake for building OpenCV code
Then just follow this blog: https://sayak.dev/install-opencv-m1/#Install-conda
OR, here is the YouTube video which explains the second step: https://youtu.be/x_kAkabk-5o
P.S. If mdfind cv2.cpython returning an empty string then try to delete the build folder and compile opencv again. Otherwise, you have done everything correctly.

E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ERROR (303)

I am using rasa 1.9.6 on ubuntu in Vmware I have been getting this error in both training as well as running the model. It allows training the model but I am unable to run it I need to run my Bot can someone please help
According to rasa forum, the origin of this issue is due to tensorflow and graphics card configuration. GPU’s do not typically provide an advantage for the Rasa models. This can be safely ignored
Installing nvidia-modprobe can solve this issue.
sudo apt install nvidia-modprobe
Other solutions you can try are :
Uninstall and install CUDA and cuDNN.
Install tensorflow-gpu.
Uninstall and install different Nvidia driver versions.
The problem also could be that only some /dev/nvidia* files are present before running Python with sudo, check using $ ls /dev/nvidia*, after running the Device Node verification script the /dev/nvidia-uvm file gets added.

When Install spacy it show failed to install builed dependencies

When i try to install spacy it show error failed to install build dependencies.I have tried on all things but cannot solve it .
I donwload from following website but no help https://www.lfd.uci.edu/~gohlke/pythonlibs/
Please help me.i am in huge trouble
The best way to install spaCy is to just run pip install -U spacy, or, if you're using conda, run conda install -c conda-forge spacy. Alternatively, you can compile it from source by cloning the repo, but usually that isn't necessary. More info can be found here.

How do I install TensorFlow's tensorboard?

How do I install TensorFlow's tensorboard?
The steps to install Tensorflow are here: https://www.tensorflow.org/install/
For example, on Linux for CPU-only (no GPU), you would type this command:
pip install -U pip
pip install tensorflow
Since TensorFlow depends on TensorBoard, running the following command should not be necessary:
pip install tensorboard
Try typing which tensorboard in your terminal. It should exist if you installed with pip as mentioned in the tensorboard README (although the documentation doesn't tell you that you can now launch tensorboard without doing anything else).
You need to give it a log directory. If you are in the directory where you saved your graph, you can launch it from your terminal with something like:
tensorboard --logdir .
or more generally:
tensorboard --logdir /path/to/log/directory
for any log directory.
Then open your favorite web browser and type in localhost:6006 to connect.
That should get you started. As for logging anything useful in your training process, you need to use the TensorFlow Summary API. You can also use the TensorBoard callback in Keras.
If your Tensorflow install is located here:
/usr/local/lib/python2.7/dist-packages/tensorflow
then the python command to launch Tensorboard is:
$ python /usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/tensorboard.py --logdir=/home/user/Documents/.../logdir
The installation from pip allows you to use:
$ tensorboard --logdir=/home/user/Documents/.../logdir
It may be helpful to make an alias for it.
Install and find your tensorboard location:
pip install tensorboard
pip show tensorboard
Add the following alias in .bashrc:
alias tensorboard='python pathShownByPip/tensorboard/main.py'
Open another terminal or run exec bash.
For Windows users, cd into pathShownByPip\tensorboard and run python main.py from there.
For Python 3.x, use pip3 instead of pip, and don't forget to use python3 in the alias.
TensorBoard isn't a separate component. TensorBoard comes packaged with TensorFlow.
Adding this just for the sake of completeness of this question (some questions may get closed as duplicate of this one).
I usually use user mode for pip ie. pip install --user even if instructions assume root mode. That way, my tensorboard installation was in ~/.local/bin/tensorboard, and it was not in my path (which shouldn't be ideal either). So I was not able to access it.
In this case, running
sudo ln -s ~/.local/bin/tensorboard /usr/bin
should fix it.
pip install tensorflow.tensorboard # install tensorboard
pip show tensorflow.tensorboard
# Location: c:\users\<name>\appdata\roaming\python\python35\site-packages
# now just run tensorboard as:
python c:\users\<name>\appdata\roaming\python\python35\site-packages\tensorboard\main.py --logdir=<logidr>
If you're using the anaconda distribution of Python, then simply do:
$❯ conda install -c conda-forge tensorboard
or
$❯ conda install -c anaconda tensorboard
Also, you can have a look at various builds by search the packages repo by:
$❯ anaconda search -t conda tensorboard
which would list the channels and the corresponding builds, the supported OS, Python versions etc.,
The pip package you are looking for is tensorflow-tensorboard developed by Google.
If you installed TensorFlow using pip, then the location of TensorBoard can be retrieved by issuing the command which tensorboard on the terminal. You can then edit the TensorBoard file, if necessary.
It is better not to mix up the virtual environments or perform installation on the root directory. Steps I took for hassle free installation are as below. I used conda for installing all my dependencies instead of pip. I'm answering with extra details, because when I tried to install tensor board and tensor flow on my root env, it messed up.
Create a virtual env
conda create --name my_env python=3.6
Activate virtual environment
source activate my_env
Install basic required modules
conda install pandas
conda install tensorflow
Install tensor board
conda install -c condo-forge tensor board
Hope that helps
I have a local install of tensorflow 1.15.0 (with tensorboard obviously included) on MacOS.
For me, the path to the relevant file within my user directory is Library/Python/3.7/lib/python/site-packages/tensorboard/main.py. So, which does not work for me, but you have to look for the file named main.py, which is weird since it apparently is named something else for other users.