pip install tensorflow==1.14.0
TensorFlow version: 1.14.0
Python version: 3.6.8
Hadoop version: Hadoop trunk (hadoop-3.3.0-SNAPSHOT)
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.6.1810 (Core)
Release: 7.6.1810
Codename: Core
I follow this link to set up Hadoop environment
After execute below snippet of code, there is no any output, and my terminal freezing up
Code to reproduce the issue
import tensorflow as tf
tf.io.gfile.makedirs("hdfs://kevin0:8020/user/root/test")
What else I need to setup?
Providing the solution here even though it is present in Github, for the benefit of the Stackoverflow Community.
Program aborted after use tf.io.gfile.makedirs issue was because of Hadoop compile from source code that don't have libhdfs in lib/native.
It was resolved after downloading Hadoop-3.2.1.
For more details please refer here
Related
I use my Macbook Pro to develop DBT Models against Databricks. Everything was working well enough, but I couldn't leave well enough alone and recently ran "dbt update" and saw that a bunch of things were outdated. I had run into issues in the past where upgrading my Python (install via Brew) broke things so I avoided upgrading Python, but upgraded SQLite. Apparently, an upgrade Python was a dependency and upgraded Python. So, DBT no longer works.
After lots of searching, I ran
brew remove dbt
brew install dbt
since the brew install dbt told me that installing dbt-labs/dbt/dbt has been deprecated, I instead ran brew install dbt-postgre figuring I will get the core DBT files install this way.
then per https://github.com/databricks/dbt-databricks, I ran
pip install dbt-databricks
All seemed mostly well except for the standard warning about "distutils config files is deprecated", etc...
Now, I run dbt debug and I get
Running with dbt=1.2.2
dbt version: 1.2.2
python version: 3.9.14
python path: /opt/homebrew/Cellar/dbt-postgres/1.2.2/libexec/bin/python
os info: macOS-12.6-arm64-arm-64bit
Using profiles.yml file at /Users/andrewpark/.dbt/profiles.yml
Using dbt_project.yml file at /Users/andrewpark/iCloud Drive (Archive)/Documents/Work >Projects/Github Source/data-platform/transformation/databricks-dbt/dbt_project.yml
18:24:13 target not specified in profile 'databricks_sql', using 'default'
18:24:13 Error importing adapter: No module named 'dbt.adapters.databricks'
Configuration:
profiles.yml file [ERROR invalid]
dbt_project.yml file [OK found and valid]
Required dependencies:
- git [OK found]
1 check failed:
Profile loading failed for the following reason:
Runtime Error
Credentials in profile "databricks_sql", target "default" invalid: Runtime Error
Could not find adapter type databricks!
I haven't touched my profiles.yml file at all so nothing there has changed, but it says the file is invalid. It appears to me that the dbt-databricks adaptor is not being found. How can I resolve this?
OS: MacOS Monterey 12.6
Python Version: 3.10.7
DBT Version (Core): 1.2.2
Also, I had installed dbt-snowflake and dbt-postgres adaptors as well as dbt-databricks, but these adaptors don't appear when I run dbt --version, only the Postgres 1.2.2 plugin.
configure profile.yml
your_profile_name:
target: dev
outputs:
dev:
type: databricks
catalog:
schema:
host:
http_path:
token:
I'm writing Python source code and using Faiss. I can use Faiss on CPU, 20xx GPU eg: RTX 2080Ti,... However, when I run on devices like RTX 3060, RTX 3070, the system freezes and I can't kill the program by Ctrl + C.
Here is the source code I use: https://github.com/facebookresearch/faiss/blob/main/tutorial/python/5-Multiple-GPUs.py
If anyone has encountered this error and successfully fixed it, please share how to do it with me.
OS: Ubuntu 20.04
Faiss version: release 1.7.1
Running on: GPU + Python
I used Anaconda, I installed bellow, it worked. If you use Docker, please install Miniconda.
conda install faiss-gpu cudatoolkit=11.1 -c pytorch-gpu
conda install -c anaconda pytorch-gpu
Not really a coding related question.
I am trying to install tensorflow on Intel Xeon(R) CPU E5620 which has Ubuntu 19.10. I can't install it with pip( could someone please explain why). It does gets installed using pip but it just says,
illegal instruction (core dumped)
I have tried building it from the source, but that was a pretty painful process, takes way too much time.
My question is, is their any easier way to install tensorflow on my PC?
Try using conda environment. I have no problem installing and using tensorflow on my machine. I am using tensorflow 1.15 btw and as far as I recall I installed it using pip install tensorflow-gpu==1.15
Cpu model: Intel(R) Xeon(R) CPU E5-2620 v4 # 2.10GHz
OS: Ubuntu 18.04
conda environment python version: 3.5.6
For Intel Z600
Processor: Xeon(R) CPU E5620
OS : Ubuntu 19.10
GPU : GTX 1050
CUDA : 10.0
cuDNN : 7.4
NCCL : 2.6
with the above configuration I successfully build tensorflow 1.14 from source, NO their is no other way to get tensorflow/tensorflow-gpu on this particular PC. I have experienced this that pip and conda don't work when installing tensorflow and that building from source or using docker as mentioned on tf official documentation is the best possible way as for 15 May 2020.
I figured that someone in near future might want to build tensorflow from source on a xeon based CPU, so I wrote how I did it step by step here, https://github.com/kazzastic/Tensorflow-BuildFromSource
I have set up a Ubuntu 18.04 and tried to make Tensorflow 2.2 GPU work (I have an Nvidia/CUDA graphic card) with Python.
Even after reading the documentation https://www.tensorflow.org/install/gpu#linux_setup, it failed (see below for details about how it failed).
Question: would you have a canonical "todo" list (starting point: freshly installed Ubuntu server) on how to install tensorflow-gpu and make it work, with a few steps?
Notes:
I have read many similar forum posts, and I think that having a canonical "todo" (from a fresh Ubuntu install to having tensorflow-gpu working) would be interesting, with a few steps/bash commands
the documentation I used involved
export LD_LIBRARY_PATH...
# Add NVIDIA package repository
sudo apt-key adv --fetch-keys http://developer.download...
...
# Install CUDA and tools. Include optional NCCL 2.x
sudo apt install cuda9.0 cuda...
Even after a lot of trial and errors (I don't copy/paste all the different errors here, would be too long), then at the end:
import tensorflow
always failed. Some reasons included `ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory. I have already read the relevant question here, or this very long (!) Github issue.
After some trial and error, import tensorflow works, but it doesn't use the GPU (see also Tensorflow not running on GPU).
Well, I was facing the same problem. The first thing to do is to look up, which Tensorflow version is required. In your case Tensorflow 2.2. requires CUDA 10.1. The correct cuDNN version is also important. In your case it would be cuDNN 7.4. An additional point is the installed python version. I would recommend Python 3.5-3.8. If one those mismatch, a fully compatibility is almost impossible.
So if you want a check list, here you go:
Install CUDA 10.1 by installing nvidia-cuda-toolkit.
Install the cuDNN version compatible with CUDA 10.1.
Export CUDA environment variables.
If Bazel is not installed, you will be asked on that.
Install TensorFlow 2.2 using pip. I would highly recommend the usage of a virtual environment.
You can find the compatibility check list of Tensorflow and CUDA here
You can find the CUDA Toolkit here
Finally get cuDNN in the correct version here
That's all.
I faced the problem as well when using the Google Cloud Platform for two projects involving deep learning. They provide servers with nothing but a freshly installed Ubuntu OS. Regarding my experience, I recommend doing the following steps:
Look up the cuda and cuDNN version supported by the current Tensorflow release on the Tensorflow page.
Install the targeted cuda version from the deb package retrieved from Nvidias cuda page and be careful that more recent cuda versions might not work! This will automatically install the corresponding Nvidia drivers.
Install the targeted cuDNN version from this page and again be careful that a more recent cuDNN version might not work.
Install tensorflow-gpu using pip.
This should work. Your problem is probably that you are using a more recent cuda version than targeted by the current Tensorflow release.
To install tensorflow-gpu, the guidelines which are provided on official website are very tedious for beginers, instead we can do these simple steps:
Note : NVIDIA driver must be installed before this(you can verify this using command nvidia-smi).
Install Anaconda https://www.anaconda.com/distribution/?
Create an virtual environment using command "conda create -n envname"
Then activate env using command "conda activate envname"
Finally install tensorflow using command "conda install tensorflow-gpu"
With the given code
import tensorflow as tf
if tf.test.gpu_device_name():
print('Default GPU Device{}'.format(tf.test.gpu_device_name()))
else:
print("not using gpu")
You can find the tutorial on link given below
https://www.pugetsystems.com/labs/hpc/Install-TensorFlow-with-GPU-Support-the-Easy-Way-on-Ubuntu-18-04-without-installing-CUDA-1170/?
I would suggest to first check the availability of GPU using nvidia-smi command.
I had faced the same issue, i was able to resolve it by using docker container, you can install docker using Install Docker Engine on Ubuntu or use the Digital Ocean guide (i used this one) How To Install and Use Docker on Ubuntu 18.04
After that it is simple just run the following command based on the requirements
NV_GPU='0' nvidia-docker run --runtime=nvidia -it -v /path/to/folder:/path/to/folder/for/docker/container nvcr.io/nvidia/tensorflow:17.11
NV_GPU='0' nvidia-docker run --runtime=nvidia -it -v /storage/research/:/storage/research/ nvcr.io/nvidia/tensorflow:20.12-tf2-py3
Here '0' represents the GPU number, if you want to use more than one GPU just use '0,1,2' and so on ....
Hope this solves the issue.
I have noticed that some newer TensorFlow versions are incompatible with older CUDA and cuDNN versions. Does an overview of the compatible versions or even a list of officially tested combinations exist? I can't find it in the TensorFlow documentation.
TL;DR) See this table: https://www.tensorflow.org/install/source#gpu
Generally:
Check the CUDA version:
cat /usr/local/cuda/version.txt
and cuDNN version:
grep CUDNN_MAJOR -A 2 /usr/local/cuda/include/cudnn.h
and install a combination as given below in the images or here.
The following images and the link provide an overview of the officially supported/tested combinations of CUDA and TensorFlow on Linux, macOS and Windows:
Minor configurations:
Since the given specifications below in some cases might be too broad, here is one specific configuration that works:
tensorflow-gpu==1.12.0
cuda==9.0
cuDNN==7.1.4
The corresponding cudnn can be downloaded here.
Tested build configurations
Please refer to https://www.tensorflow.org/install/source#gpu for a up-to-date compatibility chart (for official TF wheels).
(figures updated May 20, 2020)
Linux GPU
Linux CPU
macOS GPU
macOS CPU
Windows GPU
Windows CPU
Updated as of Dec 5 2020: For the updated information please refer Link for Linux and Link for Windows.
The compatibility table given in the tensorflow site does not contain specific minor versions for cuda and cuDNN. However, if the specific versions are not met, there will be an error when you try to use tensorflow.
For tensorflow-gpu==1.12.0 and cuda==9.0, the compatible cuDNN version is 7.1.4, which can be downloaded from here after registration.
You can check your cuda version using
nvcc --version
cuDNN version using
cat /usr/include/cudnn.h | grep CUDNN_MAJOR -A 2
tensorflow-gpu version using
pip freeze | grep tensorflow-gpu
UPDATE:
Since tensorflow 2.0, has been released, I will share the compatible cuda and cuDNN versions for it as well (for Ubuntu 18.04).
tensorflow-gpu = 2.0.0
cuda = 10.0
cuDNN = 7.6.0
if you are coding in jupyter notebook, and want to check which cuda version tf is using, run the follow command directly into jupyter cell:
!conda list cudatoolkit
!conda list cudnn
and to check if the gpu is visible to tf:
tf.test.is_gpu_available(
cuda_only=False, min_cuda_compute_capability=None
)
You can use this configuration for cuda 10.0 (10.1 does not work as of 3/18), this runs for me:
tensorflow>=1.12.0
tensorflow_gpu>=1.4
Install version tensorflow gpu:
pip install tensorflow-gpu==1.4.0
Thanks for the first answer.
Something about backward compatibility.
I can successfully install tensorflow-2.4.0 with cuda-11.1 and cudnn 8.0.5.
Source: https://www.tensorflow.org/install/source#gpu
I had installed CUDA 10.1 and CUDNN 7.6 by mistake. You can use following configurations (This worked for me - as of 9/10). :
Tensorflow-gpu == 1.14.0
CUDA 10.1
CUDNN 7.6
Ubuntu 18.04
But I had to create symlinks for it to work as tensorflow originally works with CUDA 10.
sudo ln -s /opt/cuda/targets/x86_64-linux/lib/libcublas.so /opt/cuda/targets/x86_64-linux/lib/libcublas.so.10.0
sudo cp /usr/lib/x86_64-linux-gnu/libcublas.so.10 /usr/local/cuda-10.1/lib64/
sudo ln -s /usr/local/cuda-10.1/lib64/libcublas.so.10 /usr/local/cuda-10.1/lib64/libcublas.so.10.0
sudo ln -s /usr/local/cuda/targets/x86_64-linux/lib/libcusolver.so.10 /usr/local/cuda/lib64/libcusolver.so.10.0
sudo ln -s /usr/local/cuda/targets/x86_64-linux/lib/libcurand.so.10 /usr/local/cuda/lib64/libcurand.so.10.0
sudo ln -s /usr/local/cuda/targets/x86_64-linux/lib/libcufft.so.10 /usr/local/cuda/lib64/libcufft.so.10.0
sudo ln -s /usr/local/cuda/targets/x86_64-linux/lib/libcudart.so /usr/local/cuda/lib64/libcudart.so.10.0
sudo ln -s /usr/local/cuda/targets/x86_64-linux/lib/libcusparse.so.10 /usr/local/cuda/lib64/libcusparse.so.10.0
And add the following to my ~/.bashrc -
export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export PATH=/usr/local/cuda-10.1/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/cuda/targets/x86_64-linux/lib/
I had a similar problem after upgrading to TF 2.0. The CUDA version that TF was reporting did not match what Ubuntu 18.04 thought I had installed. It said I was using CUDA 7.5.0, but apt thought I had the right version installed.
What I eventually had to do was grep recursively in /usr/local for CUDNN_MAJOR, and I found that /usr/local/cuda-10.0/targets/x86_64-linux/include/cudnn.h did indeed specify the version as 7.5.0.
/usr/local/cuda-10.1 got it right, and /usr/local/cuda pointed to /usr/local/cuda-10.1, so it was (and remains) a mystery to me why TF was looking at /usr/local/cuda-10.0.
Anyway, I just moved /usr/local/cuda-10.0 to /usr/local/old-cuda-10.0 so TF couldn't find it any more and everything then worked like a charm.
It was all very frustrating, and I still feel like I just did a random hack. But it worked :) and perhaps this will help someone with a similar issue.