※追記をまとめると以下
(pytorch,tensoflow,opencv,sklearn,pandas...)
python3の場合
python3 -c 'import torch; print(torch.__version__) '
python3 -c 'import tensorflow as tf; print(tf.__version__)'
python3 -c "import sklearn;print(sklearn.__version__);"
python3 -c "import cv2 ;print(cv2.__version__);"
python3 -c "import pandas as pd ;print(pd.__version__);"
python3 -c "import torchvision;print(torchvision.__version__);"
python3 -c "import pygame; print(pygame.version.vernum);"
pythonの場合
python -c 'import torch; print(torch.__version__) '
python -c 'import tensorflow as tf; print(tf.__version__)'
python -c "import sklearn;print(sklearn.__version__);"
python -c "import cv2 ;print(cv2.__version__);"
python -c "import pandas as pd ;print(pd.__version__);"
python -c "import torchvision;print(torchvision.__version__);"
python -c "import pygame; print(pygame.version.vernum);"
pytorchでcudaが使えるかコマンドラインから確認する
python -c "import torch; print(torch.cuda.is_available()); print(torch.cuda.get_device_name(0));"
python3 -c "import torch; print(torch.cuda.is_available()); print(torch.cuda.get_device_name(0));"
pytorchとtensoflowのバージョンをコマンドラインから調べる
以下をコマンドラインから実行すればよい
python3 -c 'import torch; print(torch.__version__) '
python3 -c 'import tensorflow as tf; print(tf.__version__)'
以下のような結果がでる
$ python3 -c 'import torch; print(torch.__version__) '
1.3.0
$ python3 -c 'import tensorflow as tf; print(tf.__version__)'
1.14.0
追記
sklearnのバージョンは以下で調べる
python3 -c "import sklearn;print(sklearn.__version__);"
opencvのバージョンは以下で調べる
python3 -c "import cv2 ;print(cv2.__version__);"
pandasのバージョンは以下で調べる
python3 -c "import pandas as pd ;print(pd.__version__);"