diff --git a/tools/installers/install_chainer.sh b/tools/installers/install_chainer.sh index 9000bfb0d5a..4ef3e4cdc58 100755 --- a/tools/installers/install_chainer.sh +++ b/tools/installers/install_chainer.sh @@ -16,6 +16,9 @@ if [ "${cuda_version}" = cpu ] || [ "${cuda_version}" = CPU ]; then fi +if ! python -c "import packaging.version" &> /dev/null; then + python3 -m pip install packaging +fi # espnet requires chiner=6.0.0 chainer_version=6.0.0 python_version=$(python3 -c "import sys; print(sys.version.split()[0])") diff --git a/tools/installers/install_fairscale.sh b/tools/installers/install_fairscale.sh index 4988a75736d..620b906ffd3 100755 --- a/tools/installers/install_fairscale.sh +++ b/tools/installers/install_fairscale.sh @@ -7,6 +7,9 @@ if [ $# != 0 ]; then exit 1; fi +if ! python -c "import packaging.version" &> /dev/null; then + python3 -m pip install packaging +fi torch_version=$(python3 -c "import torch; print(torch.__version__)") python_36_plus=$(python3 < /dev/null; then + python3 -m pip install packaging +fi torch_version=$(python3 -c "import torch; print(torch.__version__)") python_36_plus=$(python3 </dev/null) =~ pytorch ]] && echo true || echo false) fi +if ! python -c "import packaging.version" &> /dev/null; then + python3 -m pip install packaging +fi python_36_plus=$(python3 < /dev/null; then + python3 -m pip install packaging +fi torch_version=$(python3 -c "import torch; print(torch.__version__)") python_36_plus=$(python3 < /dev/null; then + python3 -m pip install packaging +fi torch_17_plus=$(python3 < /dev/null; then + python3 -m pip install packaging +fi torch_18_plus=$(python3 < /dev/null; then + python3 -m pip install packaging +fi if $(pytorch_plus 1.11.1); then log "[ERROR] This script doesn't support pytorch=${torch_version}" diff --git a/tools/installers/install_torch_optimizer.sh b/tools/installers/install_torch_optimizer.sh index a4b42d4fade..49fad9d504c 100755 --- a/tools/installers/install_torch_optimizer.sh +++ b/tools/installers/install_torch_optimizer.sh @@ -7,6 +7,9 @@ if [ $# != 0 ]; then exit 1; fi +if ! python -c "import packaging.version" &> /dev/null; then + python3 -m pip install packaging +fi torch_version=$(python3 -c "import torch; print(torch.__version__)") python_36_plus=$(python3 < /dev/null; then + python3 -m pip install packaging +fi torch_17_plus=$(python3 < /dev/null; then + python3 -m pip install packaging +fi # TODO(kamo): Consider clang case # Note: Requires gcc>=4.9.2 to build extensions with pytorch>=1.0 if python3 -c 'import torch as t;assert t.__version__[0] == "1"' &> /dev/null; then \