From 7677f9dccd054f7cbe5d38ff1ba7b344033dce56 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Sun, 6 Oct 2019 21:57:50 +0300 Subject: [PATCH] Fix example Windows support --- examples/manual_model_config.py | 6 +++++- examples/requirements.txt | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/manual_model_config.py b/examples/manual_model_config.py index 7b3434a1..007dd130 100644 --- a/examples/manual_model_config.py +++ b/examples/manual_model_config.py @@ -1,5 +1,8 @@ # TRAINS - Example of manual model configuration # +import os +from tempfile import gettempdir + import torch from trains import Task @@ -25,5 +28,6 @@ print('Any model stored from this point onwards, will contain both model_config and label_enumeration') # storing the model, it will have the task network configuration and label enumeration -torch.save(model, '/tmp/model') + +torch.save(model, os.path.join(gettempdir(), "model")) print('Model saved') diff --git a/examples/requirements.txt b/examples/requirements.txt index 4e8101e5..c63b5e2c 100644 --- a/examples/requirements.txt +++ b/examples/requirements.txt @@ -1,7 +1,8 @@ absl-py>=0.7.1 Keras>=2.2.4 joblib>=0.13.2 -matplotlib>=3.1.1 +matplotlib>=3.1.1 ; python_version >= '3.6' +matplotlib == 3.0.3 ; python_version < '3.6' seaborn>=0.9.0 sklearn>=0.0 tensorboard>=1.14.0