Package 'ffmpeg' has no installation candidate while installing tensorflow - tensorflow

I`m a german studant. For the school I have to make a physics or chemistry project, I decided to install tensorflow on a raspberry pi to train a object detection modal.
But there is an error I don´t understand.
'Package 'ffmpeg' has no insstallation candidate.'
I tried to install ffmpeg from source but this didn´t help
I use a raspberry pi 4 4gb ram.
With Raspbain 10 (buster)

Try installling libav-tools package, apt-get install libav-tools and avconv command instead of ffmpeg. libav is a fork of ffmpeg
Appropriate sources
Ubuntu source
pi forum

Related

The kernel appears to have died. It will restart automatically. Jupyter notebook [duplicate]

I am using a MacBook Pro with M1 processor, macOS version 11.0.1, Python 3.8 in PyCharm, Tensorflow version 2.4.0rc4 (also tried 2.3.0, 2.3.1, 2.4.0rc0). I am trying to run the following code:
import tensorflow
This causes the error message:
Process finished with exit code 132 (interrupted by signal 4: SIGILL)
The code runs fine on my Windows and Linux machines.
What does the error message mean and how can I fix it?
Seems that this problem happens when you have multiple python interpreters installed, and some of them are for differente architectuers (x86_64 vs arm64). You need to make sure that the correct python interpreter is being used, if you installed Apple's version of tensorflow, then that probably requires an arm64 interpreter.
If you use rosetta (Apple's x86_64 emulator) then you need to use a x86_64 python interpreter, if you somehow load the arm64 python interpreter, you will get the illegal instruction error (which totally makes sense).
If you use any script that installs new python interpreters, then you need to make sure the correct interpreter for the architecture is installed (most likely arm64).
Overalll I think this problem happens because the python environment setup is not made for systems that can run multiple instruction sets/architectures, pip does check the architecture of packages and the host system but seems you can run a x86_64 interpreter to load a package meant for arm64 and this produces the problem.
For reference there is an issue in tensorflow_macos that people can check.
For M1 Macs, From Apple developer page the following worked:
First, download Conda Env from here and then follow these instructions (assuming the script is downloaded to ~/Downloads folder)
chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
source ~/miniforge3/bin/activate
reload the shell and do
python -m pip uninstall tensorflow-macos
python -m pip uninstall tensorflow-metal
conda install -c apple tensorflow-deps
python -m pip install tensorflow-macos
python -m pip install tensorflow-metal
If the above doesn't work for some reason, there are some edge cases and additional information provided at the Apple developer page
Installing Tensorflow version 1.15 fixed this for me.
$ conda install tensorflow==1.15
I have been able to resolve this issue by using Miniforge instead of Anaconda as the Python environment. Anaconda doesn't support the arm64 architecture, yet.
I had the same issue
This is because of M1 chip. Now there is a pre-release that delivers hardware-accelerated TensorFlow and TensorFlow Addons for macOS 11.0+. Native hardware acceleration is supported on M1 Macs and Intel-based Macs through Apple’s ML Compute framework.
You need to install the TensorFlow that supports M1 chip Simply pull this tensorflow macos repository and run the ./scripts/download_and_install.sh

Problem with installing tensorflow on Raspberry pi-Error:Tensorflow is not a supported wheel on this platfrom

I tried to install tensorflow on my raspberry pi using the instructions on this link:
https://github.com/PINTO0309/Tensorflow-bin/#usage
I faced the error below:
These are some information you may need to help me solving this error:
OS:Raspbian GNU/Linux 11 (Bullseye)
Python 3.9.2
pip 22.0.4
Do you have any idea how I can solve this error and install tensorflow completely?
Thanks

Installing tensorflow 1.9 on raspberry pi*addressed by modifying code to work with tf 2

updated code to work with tensorflow 2.4 to get around issue
I'm trying to install Tensorflow 1.9 on a Raspberry Pi as it is a requirement of the code I want to run. It installs fine on my Macbook using pip install tensorflow==1.9.0, but on the Pi I get the error:
Could not find a version that satisfies the requirement tensorflow==1.9.0 (from versions: 0.11.0, 1.11.0, 1.12.0, 1.13.1, 1.14.0)
No matching distribution found for tensorflow==1.9.0
I'm using a Conda (miniconda3) environment with Python 3.6.
Would using Ubuntu Desktop instead of Raspberry Pi OS work maybe? Or is there perhaps a way to build it from https://github.com/tensorflow/tensorflow/tree/r1.9?
You need to install python version 3.6 or other compatible versions in conda. Tensorflow does not work on versions higher than 3.8 and has identified issues with some other versions. I recommend using python 3.6 through conda. You will also probably need to move the
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
files from anaconda3\Library\bin to anaconda3/DLLs. You can find more details about this issue if you run into it here.
Hope this answers your question!
To install Tensorflow on Raspberry Pi run:
sudo apt install libatlas-base-dev
and then
pip3 install tensorflow
You can also compilte TensorflowLite and use if you wish. The compile TensorflowLite on RPi refer this link

Install Tensorflow-GPU on WSL2

Has anyone successfully installed Tensorflow-GPU on WSL2 with NVIDIA GPUs? I have Ubuntu 18.04 on WSL2, but am struggling to get NVIDIA drivers installed. Any help would be appreciated as I'm lost.
So I have just got this running.
The steps you need to follow are here. To summarise them:
sign up for windows insider program and get the development builds of windows so that you have the latest version
Install wsl 2
Install Ubuntu from the windows store
Install the wsl 2 cuda driver on windows
Install cuda toolkit
Install cudnn (you can download the linux version from windows and then copy the file to linux)
If you are getting memory errors like 'cannot allocate memory' then you might need to increase the amount of memory wsl can get
Then install tensorflow-gpu
pray it works
bugs I hit along the way:
If when you open ubuntu for the first time you get an error you need to enable virutalisation in the bios
If you cannot run the ./Blackscholes example in the installation instructions you might not have the right build of windows! You must have the right version
if you are getting 'cannot allocate memory' errors when running tf you need to give wsl more ram. It only access half your ram by default
create a .wslconfig file under your user directory in windows with the amount of memory you want. Mine looks like:
[wsl2]
memory=16GB
Edit after running some code
This is much slower then when I was running on windows directly. I went from 1 minute per epoch to 5 minutes. I'm just going to dualboot.
These are the steps I had to follow for Ubuntu 20.04. I am no longer on dev channel, beta channel works fine for this use case and is much more stable.
Install WSL2
Install Ubuntu 20.04 from Windows Store
Install Nvidia Drivers for Windows from: https://developer.nvidia.com/cuda/wsl/download
Install nvcc inside of WSL with:
sudo apt install nvidia-cuda-toolkit
Check that it is there with:
nvcc --version
For my use case, I do data science and already had anaconda installed. I created an environment with:
conda create --name tensorflow
conda install tensorflow-gpu
Then just test it with this little python program with the environment activated:
import tensorflow as tf
tf.config.list_physical_devices('GPU')
sys_details = tf.sysconfig.get_build_info()
cuda = sys_details["cuda_version"]
cudnn = sys_details["cudnn_version"]
print(cuda, cudnn)
For reasons I do not understand, my machine was unable to find the GPU without installing the nvcc and actually gave an error message saying it could not find nvcc.
Online tutorials I had found which had you downloading CUDA and CUDNN separately but I thinkNVCC includes CUDNN since it is . . . there somehow.
I can confirm I am able to get this working without the need for Docker on WSL2 thanks to the following article:
https://qiita.com/Navier/items/cf551908bae707db4258
Be sure to update to driver version 460.15, not 455.41 as listed in the CUDA documentation.
Note, this does not work with the card in TCC mode (only WDDM). Also, be sure to place your files on the Linux file system (i.e. not on a mount drive, like /mnt/c/). Performance is significantly faster on the Linux file system (this has to do with the difference in implementation of WSL 1 vs. WSL 2; see 1, 2, and 3).
NOTE: See also Is the class generator (inheriting Sequence) thread safe in Keras/Tensorflow?
I just want to point out that using anaconda to install cudatoolkit and cudnn does not seem to work in wsl.
Maybe there is some problem with paths that make TF look for the needed files only in the system paths instead of the conda enviroments.

Updating bazel on Raspberry Pi 3

I followed this step by step guide here:
https://github.com/samjabrahams/tensorflow-on-raspberry-pi/blob/master/GUIDE.md
in order to install and build Tensorflow on Raspberry Pi 3 B+.
But, when I reach the point it says:
./configure
I get this error:
You have bazel 0.4.5- (#non-git) installed. Please upgrade your bazel
installation to version 0.19.0 or higher to build TensorFlow!
Then I followed these instructions:
Unable to install bazel on Ubuntu 14.04 using apt-get
and used the file:
bazel-0.22.0-installer-linux-x86_64.sh
from here:
https://github.com/bazelbuild/bazel/releases
but when I am trying ./configure, I got again the same message. I spent two days searching google and tutorials, doing nothing...
You can't use the "bazel-0.22.0-installer-linux-x86_64.sh" as your CPU is ARM architecture not x86_64.
Try to follow this guide: https://gist.github.com/EKami/9869ae6347f68c592c5b5cd181a3b205#3-build-bazel