| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -47,7 +47,7 @@ RUN conda config --add channels conda-forge && \ | |||
| 47 | 47 | conda install matplotlib basemap cartopy python-igraph imagemagick "pysal==2.1.0" && \ | |
| 48 | 48 | # b/142337634#comment22 pin required to avoid torchaudio downgrade. | |
| 49 | 49 | # b/162357958##comment7 Upgrade once new versions of torch* libs are released for pytorch 1.6. | |
| 50 | - conda install "pytorch=1.5" "torchvision=0.6" "torchaudio=0.5" "torchtext=0.6" cpuonly && \ | ||
| 50 | + conda install "pytorch=1.6" "torchvision=0.7" "torchaudio=0.6" "torchtext=0.7" cpuonly && \ | ||
| 51 | 51 | /tmp/clean-layer.sh | |
| 52 | 52 | ||
| 53 | 53 | # The anaconda base image includes outdated versions of these packages. Update them to include the latest version. | |
@@ -343,8 +343,7 @@ RUN pip install bcolz && \ | |||
| 343 | 343 | pip install nbformat && \ | |
| 344 | 344 | pip install notebook==5.5.0 && \ | |
| 345 | 345 | pip install olefile && \ | |
| 346 | - # b/162850432 unpin once we upgrade to pytorch 1.6 | ||
| 347 | - pip install kornia==0.3.2 && \ | ||
| 346 | + pip install kornia && \ | ||
| 348 | 347 | pip install pandas_summary && \ | |
| 349 | 348 | pip install pandocfilters && \ | |
| 350 | 349 | pip install pexpect && \ | |
@@ -374,8 +373,7 @@ RUN pip install bcolz && \ | |||
| 374 | 373 | pip install widgetsnbextension && \ | |
| 375 | 374 | pip install pyarrow && \ | |
| 376 | 375 | pip install feather-format && \ | |
| 377 | - # b/162850432 unpin once we upgrade to pytorch 1.6 | ||
| 378 | - pip install fastai~=1.0.61 && \ | ||
| 376 | + pip install fastai && \ | ||
| 379 | 377 | pip install allennlp && \ | |
| 380 | 378 | python -m spacy download en && python -m spacy download en_core_web_lg && \ | |
| 381 | 379 | apt-get install -y ffmpeg && \ | |
@@ -426,7 +424,8 @@ RUN pip install flashtext && \ | |||
| 426 | 424 | pip install plotly_express && \ | |
| 427 | 425 | pip install albumentations && \ | |
| 428 | 426 | pip install catalyst && \ | |
| 429 | - pip install osmnx && \ | ||
| 427 | + # b/162850432 prevent matplotlib upgrade. | ||
| 428 | + pip install osmnx==0.15.1 && \ | ||
| 430 | 429 | apt-get -y install libspatialindex-dev && \ | |
| 431 | 430 | pip install pytorch-ignite && \ | |
| 432 | 431 | pip install qgrid && \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,7 +61,7 @@ RUN apt-get install -y ocl-icd-libopencl1 clinfo libboost-all-dev && \ | |||
| 61 | 61 | # However, because this image is based on the CPU image, this isn't possible but better | |
| 62 | 62 | # to put them at the top of this file to minize conflicts. | |
| 63 | 63 | RUN conda remove --force -y pytorch torchvision torchaudio cpuonly && \ | |
| 64 | - conda install "pytorch=1.5" "torchvision=0.6" "torchaudio=0.5" "torchtext=0.6" cudatoolkit=$CUDA_VERSION && \ | ||
| 64 | + conda install "pytorch=1.6" "torchvision=0.7" "torchaudio=0.6" "torchtext=0.7" cudatoolkit=$CUDA_VERSION && \ | ||
| 65 | 65 | /tmp/clean-layer.sh | |
| 66 | 66 | ||
| 67 | 67 | # Install LightGBM with GPU | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,21 +1,12 @@ | |||
| 1 | 1 | import unittest | |
| 2 | 2 | ||
| 3 | 3 | import fastai | |
| 4 | - import pandas as pd | ||
| 5 | - import torch | ||
| 6 | 4 | ||
| 7 | - from fastai.tabular import * | ||
| 8 | - from fastai.core import partition | ||
| 9 | - from fastai.torch_core import tensor | ||
| 5 | + from fastai.tabular.all import * | ||
| 10 | 6 | ||
| 11 | 7 | class TestFastAI(unittest.TestCase): | |
| 12 | - def test_partition(self): | ||
| 13 | - result = partition([1,2,3,4,5], 2) | ||
| 14 | - | ||
| 15 | - self.assertEqual(3, len(result)) | ||
| 16 | - | ||
| 17 | 8 | def test_has_version(self): | |
| 18 | - self.assertGreater(len(fastai.__version__), 1) | ||
| 9 | + self.assertGreater(len(fastai.__version__), 2) | ||
| 19 | 10 | ||
| 20 | 11 | # based on https://github.com/fastai/fastai/blob/master/tests/test_torch_core.py#L17 | |
| 21 | 12 | def test_torch_tensor(self): | |
@@ -25,18 +16,12 @@ def test_torch_tensor(self): | |||
| 25 | 16 | self.assertTrue(torch.all(a == b)) | |
| 26 | 17 | ||
| 27 | 18 | def test_tabular(self): | |
| 28 | - df = pd.read_csv("/input/tests/data/train.csv") | ||
| 29 | - procs = [FillMissing, Categorify, Normalize] | ||
| 30 | - | ||
| 31 | - valid_idx = range(len(df)-5, len(df)) | ||
| 32 | - dep_var = "label" | ||
| 33 | - cont_names = [] | ||
| 34 | - for i in range(784): | ||
| 35 | - cont_names.append("pixel" + str(i)) | ||
| 36 | - | ||
| 37 | - data = (TabularList.from_df(df, path="", cont_names=cont_names, cat_names=[], procs=procs) | ||
| 38 | - .split_by_idx(valid_idx) | ||
| 39 | - .label_from_df(cols=dep_var) | ||
| 40 | - .databunch()) | ||
| 41 | - learn = tabular_learner(data, layers=[200, 100]) | ||
| 42 | - learn.fit(epochs=1) | ||
| 19 | + dls = TabularDataLoaders.from_csv( | ||
| 20 | + "/input/tests/data/train.csv", | ||
| 21 | + cont_names=["pixel"+str(i) for i in range(784)], | ||
| 22 | + y_names='label', | ||
| 23 | + procs=[FillMissing, Categorify, Normalize]) | ||
| 24 | + learn = tabular_learner(dls, layers=[200, 100]) | ||
| 25 | + learn.fit_one_cycle(n_epoch=1) | ||
| 26 | + | ||
| 27 | + self.assertGreater(learn.smooth_loss, 0) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments