This is Qiita's first post. I would be grateful if you could let me know if there are any points that cannot be reached.
Build an environment for pytorch, tensorflow, and keras on a PC equipped with NVIDIA Geforce GTX 1060. Please note that it often does not work with different versions.
--nvidia driver (version is arbitrary (?))
GPU confirmation
ubuntu-drivers devices
2 . Driver installation
install_driver
sudo ubuntu-drivers install [Driver version(Is it safe to use recommended ones such as 435??)]
#autoinstall seems not recommended
#For more information ubuntu-drivers --Run help
3 . Restart your PC
4 . It is OK if you can get information such as driver by executing nvidia-smi
.
Reference
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
It may become like. At this time, disable Nouveau
sudo vim /etc/modprobe.d/blacklist-nouveau.conf
blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0
Fill in
2. sudo update-initramfs -u
3 . PC restart
See the reference above for details.
-Select the environment you are using from nvidia_driver_download and download the driver.
[](--You can check your environment in the nvidia control panel by right-clicking on the desktop ??)
--Launch the installer (all defaults are OK)
--Open a command prompt and execute nvidia-smi
to get information such as drivers.
-Installing guide of anaconda by python japan -anaconda Official Install according to
--Launch anaconda prompt (for windows). In ubuntu, it is OK if (base) is attached to the command line.
Reference
conda create -n environment name python = version
Create a virtual environment with. Here, the environment name is arbitrary and the version is 3.6.
--Environment activation
conda activate environment name
It's okay if you see (environment name) on the command line.
If you select your environment in pytorch official, the necessary commands will appear.
In my environment
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
was.
Reference (pytorch official) Start python
Confirmation
import torch
torch.cuda.is_available()
To execute. If True, you can recognize
** Note: cuda-toolkit requires version 9.1 for tensorflow-gpu == 1.12.0, so you need something different from pytorch. Therefore, it is necessary to separate pytorch and virtual environment **
conda install tensorflow-gpu==1.12.0
Reference Start python
Confirmation
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
And. If the GPU is displayed, the GPU is recognized
conda install keras==2.2.4
-Use keras-yolov3 -Learning fine tuning of nvidia-jetson classification with pc and putting it on jetson nano -Learning fine tuning of nvidia-jetson detection on pc and putting it on jetson nano
I would appreciate it if you could let me know if there is a problem with the page. Thank you to everyone on the page for reference.
-Install CUDA on Ubuntu 18.04 -Installing guide of anaconda by python japan -anaconda Official -[For beginners] Create a virtual environment with Anaconda -pytorch official -Check if GPU can be recognized from TensorFlow with 2-line code