How to update tensorflow to support tf.contrib? - machine-learning

I want use initializers and batch_norm in tf.contrib module, but my program says can't find it. I re-install tensorflow still can't use tf.contrib module. Can anyone tell me why?

I don't know what you did, but you certainly don't have the latest Tensorflow version from Google. You should follow this tutorial to install it.
To sum it up:
Make sure you have the dependencies: sudo apt-get install python-pip python-dev
Uninstall whatever you have right now: pip uninstall tensorflow
Set up variables:
Choose the correct one:
# Ubuntu/Linux 64-bit, CPU only, Python 2.7
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
# Ubuntu/Linux 64-bit, GPU enabled, Python 2.7
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp27-none-linux_x86_64.whl
# Ubuntu/Linux 64-bit, CPU only, Python 3.4
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl
# Ubuntu/Linux 64-bit, GPU enabled, Python 3.4
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp34-cp34m-linux_x86_64.whl
# Ubuntu/Linux 64-bit, CPU only, Python 3.5
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl
# Ubuntu/Linux 64-bit, GPU enabled, Python 3.5
# Requires CUDA toolkit 7.5 and CuDNN v4. For other versions, see "Install from sources" below.
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl
Install it
Choose the correct one:
# Python 2
$ sudo pip install --upgrade $TF_BINARY_URL
# Python 3
$ sudo pip3 install --upgrade $TF_BINARY_URL

Related

Installing opencv-python on raspberry pi 3, Raspbian Stretch

As above, trying to install opencv-python.
Normally this would be a simple pip install opencv-python, but it doesn't seem to work. Instead, opencv install to the miniconda directory
/home/pi/miniconda3/lib/python3.5/site-packages
instead of global
/usr/lib/python3.7
Trying to add opencv-python in Thorny through the application fails. In the python program...
import sys
sys.path.append('/home/pi/miniconda3/lib/python3.5/site-packages')
import cv2
results in a
No module named 'cv2.cv2'
I've tried adding it to path also (export PYTHONPATH=/home/pi/miniconda3/lib/python3.5/site-packages:$PYTHONPATH) with no luck.
Because pip is linked to your default Python and I think this default is your miniconda. A better approach is to call the Python version directly with pip. Additionally #Dave W. Smit mentioned that you should better install opencv-python-contrib to use the full OpenCV package (but don´t use both packages!).
$ python-3.7 -m pip install opencv-python-contrib
Or you can use the pip version (if pip is at least version 0.8)
$ pip-3.7 install opencv-python-contrib
Or with pip version 1.5+
$ pip3.7 install opencv-python-contrib

Install packages from PYPI in Raspberry Pi

I want to install a precompiled version of OpenCV 3.4.2 in the Raspberry using the following commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install pip3
sudo pip3 install opencv-python
But it failed and the error message was: "Could not find a version that satisfies the requirement opencv-python (from versions: ) No matching distribution found for opencv-python"
Then tried the following commands but the result was the same:
sudo apt-get install python3-pip
sudo pip install opencv-python
I had not problems installing it on my PC with ubuntu 16 using the same commands. This is the page im using for reference https://pypi.org/project/opencv-python/
I'm using Raspbian Jessie Lite, Python 3.4
The list of downloadable files for opencv includes binary wheels for many Python versions but for limited set of architectures: MacOSX on Intel, Linux on Intel 32 and 64 bits, Windows on Intel 32 and 64 bits. Raspberry Pi processors absent and there is no source code so pip cannot compile it.
The FAQ recommends to look up Pi wheels at https://www.piwheels.org/.

Failed to run conda install -c menpo opencv3=3.2.0 in Windows7

I want to update opencv from 3.1.0 to 3.2.0
I run "conda install -c menpo opencv3=3.1.0" to install opencv 3.1.0
when I run "conda install -c menpo opencv3=3.2.0", I got error.
C:\Users\eason>conda install -c menpo opencv3=3.2.0
Fetching package metadata .............
PackageNotFoundError: Package not found: '' Package missing in current win-64 ch
annels:
- opencv3 3.2.0*
You can search for packages on anaconda.org with
anaconda search -t conda opencv3
https://anaconda.org/menpo/opencv3
When I run "anaconda search -t conda opencv3"...
I found opencv3=3.2.0 , but I can't install it?
Is anyone helps ? thanks!
run the following command
conda install -c conda-forge opencv=3.2.0
The menpo file page shows only OpenCV 3.2.0 for Python 2.7/3.4/3.5 on linux-64 platform is available.
If you are using Python 3.4, you may try this:
conda install -c daleydeng opencv=3.2.0
Just pushed my OpenCV 3.2 binary to github. It compiled with opencv_contrib modules and runs on Win10 64-bit with Python 2.7.
You may have a trial. Good Luck!
Open Anaconda terminal
Navigate to the folder in Anaconda main folder which contains Python Scripts
Download the un-offical opencv + contrib binaries from here
In the Anaconda terminal do pip install

Problems installing scikit-image in ubuntu 14.04

When I try to install scikit-image with pip2 there is show error. I have tried to find this problem solution.
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/scikit-image
Storing debug log for failure in /home/nshakib/.pip/pip.log
My guess is that you might have missing dependencies. I don't think Ubuntu 14.04 comes out of the box with any of the SciPy stack.
To answer your question try,
sudo apt-get install python-matplotlib python-numpy python-pil python-scipy
Then
sudo apt-get install build-essential cython
Finally
sudo apt-get install python-skimage
If that still doesn't work, you could try using the Anaconda Distribution for Python 2.7 from Continuum Analytics.
It comes with many of the major packages built-in and has a great package manager that manages dependencies.
https://docs.continuum.io/anaconda/install#anaconda-install
The conda package would be installed with conda install scikit-image

How to Install wkhtmltopdf?

Now i am working on rails 3.0.0.i am using Ubuntu 11.10 ,64 bit os.i want to install wkhtmltopdf.please tell me the static version of wkhtmltopdf.
Installing wkhtmltopdf
on Ubuntu Linux machine
First check os is 32 bit or 64 bit by using following command
Try uname -m. It seems like the uname -m actually gives x86_64 when it is an kernel 64 bits
Run following command
sudo apt-get install openssl build-essential xorg libssl-dev libxrender-dev
Then run following command
sudo apt-get install wkhtmltopdf
Based on OS download wkhtmltopdf package from following site
http://code.google.com/p/wkhtmltopdf/downloads/list
OR
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
(wkhtmltopdf-0.9.9-static-i386.tar.bz2 is a stable release for wkhtmltopdf )
Then extract using command
tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
Then move extracted DIR to usr/local/bin folder
sudo mv wkhtmltopdf-i386 /usr/local/bin/wkhtmltopdf
Check wkhtmltopdf is install or not using following command
which wkhtmltopdf
wkhtmltopdf –help
Installing wkhtmltopdf on MacOs
brew install Caskroom/cask/wkhtmltopdf
Another way to use official binaries within Rails is adding the following line to your Gemfile:
gem 'wkhtmltopdf-installer'
This way the official binaries from http://wkhtmltopdf.org will be downloaded and added to your bundle during bundle install phase.
I encountered this problem this morning.
Before you do anything, please check out: https://github.com/pdfkit/pdfkit/wiki/Installing-WKHTMLTOPDF
Download a binary edition of wkhtmltopdf at http://code.google.com/p/wkhtmltopdf/downloads/list
Decompress the package.
Copy the file like wkhtmltopdf-i386 to /usr/local/bin/ & /opt/ (also you could make soft link).
That's done.
Good luck.

Resources