fix lib paths after Wandb 0.10 (#3520)

* try

* try

* drop 0.20

* drop 0.19.5

* -U

* Fixed Horovod in CI due to wandb==0.10.0 sys.path modifications (#3525)

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>

* format

* wb freeze

* types

Co-authored-by: Travis Addair <taddair@uber.com>
This commit is contained in:
Jirka Borovec 2020-09-17 14:37:49 +02:00 committed by GitHub
parent 76c4afb840
commit 7b64472ced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 5 deletions

View File

@ -83,7 +83,7 @@ jobs:
run: |
# python -m pip install --upgrade --user pip
pip install --requirement requirements/base.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet --upgrade
HOROVOD_BUILD_ARCH_FLAGS="-mfma" pip install --requirement ./requirements/devel.txt --quiet --upgrade-strategy "only-if-needed"
HOROVOD_BUILD_ARCH_FLAGS="-mfma" pip install --requirement ./requirements/devel.txt --quiet --upgrade
python --version
pip --version
pip list

View File

@ -33,7 +33,8 @@
"pytorch_lightning/trainer/lr_scheduler_connector.py",
"pytorch_lightning/trainer/training_loop_temp.py",
"pytorch_lightning/trainer/connectors/checkpoint_connector.py",
"pytorch_lightning/tuner"
"pytorch_lightning/tuner",
"pytorch_lightning/plugins"
],
"reportMissingImports": false

View File

@ -4,7 +4,7 @@ neptune-client>=0.4.109
comet-ml>=3.1.12
mlflow>=1.0.0
test_tube>=0.7.5
wandb>=0.8.21
wandb>=0.8.21, <0.10.0 # higher version mess with system paths
matplotlib>=3.1.1
# no need to install with [pytorch] as pytorch is already installed and torchvision is required only for Horovod examples
horovod>=0.19.2

View File

@ -24,15 +24,20 @@ import sys
try:
import horovod.torch as hvd
except (ModuleNotFoundError, ImportError):
except ImportError:
print('You requested to import Horovod which is missing or not supported for your OS.')
PATH_HERE = os.path.abspath(os.path.dirname(__file__))
PATH_ROOT = os.path.join(PATH_HERE, '..', '..', '..', '..')
PATH_ROOT = os.path.abspath(os.path.join(PATH_HERE, '..', '..', '..', '..'))
sys.path.insert(0, os.path.abspath(PATH_ROOT))
from pytorch_lightning import Trainer # noqa: E402
from pytorch_lightning.callbacks import ModelCheckpoint # noqa: E402
# Move project root to the front of the search path, as some imports may have reordered things
idx = sys.path.index(PATH_ROOT)
sys.path[0], sys.path[idx] = sys.path[idx], sys.path[0]
from tests.base import EvalModelTemplate # noqa: E402
from tests.base.develop_pipelines import run_prediction # noqa: E402
from tests.base.develop_utils import set_random_master_port, reset_seed # noqa: E402