Skip to content

Commit

Permalink
Pin numpy to version <2 for broken examples (#184)
Browse files Browse the repository at this point in the history
* Pin numpy to version <2 for broken examples

* Fix more failures
  • Loading branch information
Lothiraldan committed Jul 8, 2024
1 parent f633c70 commit 8149415
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
14 changes: 9 additions & 5 deletions guides/computer_vision/Computer_Vision_with_Comet.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"outputs": [],
"source": [
"%pip install comet_ml torch torchvision timm datasets h5py scipy scikit-learn \"pandas<2\""
"%pip install comet_ml torch torchvision timm datasets h5py scipy scikit-learn \"pandas<2\" \"numpy<2\""
]
},
{
Expand Down Expand Up @@ -131,12 +131,16 @@
"\n",
"# Sample 1000 examples from the training split as our training set\n",
"NUM_TRAIN_SAMPLES = 1000\n",
"train_dataset = load_dataset(\"svhn\", \"cropped_digits\", split=\"train\", streaming=True)\n",
"train_dataset = load_dataset(\n",
" \"svhn\", \"cropped_digits\", split=\"train\", streaming=True, trust_remote_code=True\n",
")\n",
"train_dataset = train_dataset.take(NUM_TRAIN_SAMPLES)\n",
"\n",
"# Sample 100 examples from the training split as our test set\n",
"NUM_TEST_SAMPLES = 100\n",
"test_dataset = load_dataset(\"svhn\", \"cropped_digits\", split=\"test\", streaming=True)\n",
"test_dataset = load_dataset(\n",
" \"svhn\", \"cropped_digits\", split=\"test\", streaming=True, trust_remote_code=True\n",
")\n",
"test_dataset = test_dataset.take(NUM_TEST_SAMPLES)\n",
"\n",
"transforms = T.Compose([T.ToTensor(), T.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))])\n",
Expand Down Expand Up @@ -640,9 +644,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15"
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
6 changes: 3 additions & 3 deletions guides/get-started/Comet_Quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},
"outputs": [],
"source": [
"%pip install -U comet_ml"
"%pip install -U comet_ml \"numpy<2.0.0\""
]
},
{
Expand Down Expand Up @@ -705,9 +705,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
},
"outputs": [],
"source": [
"%pip install comet_ml prophet plotly"
"%pip install comet_ml prophet plotly \"numpy<2.0.0\""
]
},
{
Expand Down Expand Up @@ -212,9 +212,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"outputs": [],
"source": [
"%pip install torch torchvision \"pytorch-lightning<2.0.0\""
"%pip install torch torchvision \"pytorch-lightning<2.0.0\" \"numpy<2.0.0\""
]
},
{
Expand Down Expand Up @@ -249,9 +249,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"outputs": [],
"source": [
"%pip install 'gymnasium[classic-control]' comet_ml stable-baselines3"
"%pip install 'gymnasium[classic-control]' comet_ml stable-baselines3 \"numpy<2.0.0\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ def evaluate_classification_metrics(self):

device = "cuda" if torch.cuda.is_available() else "cpu"
dataset = load_dataset(
self.dataset_name, split=self.dataset_split, streaming=True
self.dataset_name,
split=self.dataset_split,
streaming=True,
trust_remote_code=True,
)
dataset = dataset.shuffle(self.seed, buffer_size=10_000)
dataset = dataset.take(self.n_samples)
Expand Down

0 comments on commit 8149415

Please sign in to comment.