| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 215becf commit c462fc1
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,7 @@ | |||
| 1 | - # b/157908450 set to latest once numba 0.49.x fixes performance regression for datashader. | ||
| 2 | - ARG BASE_TAG=m46 | ||
| 1 | + ARG BASE_TAG=m61 | ||
| 3 | 2 | ARG TENSORFLOW_VERSION=2.4.0 | |
| 4 | 3 | ||
| 5 | - FROM gcr.io/kaggle-images/python-tensorflow-whl:${TENSORFLOW_VERSION}-py37 as tensorflow_whl | ||
| 4 | + FROM gcr.io/kaggle-images/python-tensorflow-whl:${TENSORFLOW_VERSION}-py37-2 as tensorflow_whl | ||
| 6 | 5 | FROM gcr.io/deeplearning-platform-release/base-cpu:${BASE_TAG} | |
| 7 | 6 | ||
| 8 | 7 | ADD clean-layer.sh /tmp/clean-layer.sh | |
@@ -210,8 +209,6 @@ RUN pip install mpld3 && \ | |||
| 210 | 209 | pip install fbprophet && \ | |
| 211 | 210 | pip install holoviews && \ | |
| 212 | 211 | pip install geoviews && \ | |
| 213 | - # b/177279594 umap-learn 0.5.0 is causing a llvmlite upgrade. | ||
| 214 | - pip install umap-learn==0.4.6 && \ | ||
| 215 | 212 | pip install hypertools && \ | |
| 216 | 213 | pip install py_stringsimjoin && \ | |
| 217 | 214 | pip install mlens && \ | |
@@ -320,8 +317,7 @@ RUN pip install bleach && \ | |||
| 320 | 317 | pip install pandocfilters && \ | |
| 321 | 318 | pip install pexpect && \ | |
| 322 | 319 | pip install pickleshare && \ | |
| 323 | - # b/160263325: the version included in the m46 base image has a known issue. | ||
| 324 | - pip install --upgrade Pillow && \ | ||
| 320 | + pip install Pillow && \ | ||
| 325 | 321 | # Install openslide and its python binding | |
| 326 | 322 | apt-get install -y openslide-tools && \ | |
| 327 | 323 | pip install openslide-python && \ | |
@@ -373,7 +369,7 @@ RUN pip install flashtext && \ | |||
| 373 | 369 | pip install shap && \ | |
| 374 | 370 | pip install ray && \ | |
| 375 | 371 | pip install gym && \ | |
| 376 | - # b/167220714 unpin once matplotlib >= 3.3 is installed in the base image. | ||
| 372 | + # b/167268016 tensorforce 0.6.6 has an explicit dependency on tensorflow 2.3.1 which is causing a downgrade. | ||
| 377 | 373 | pip install tensorforce==0.5.5 && \ | |
| 378 | 374 | pip install pyarabic && \ | |
| 379 | 375 | pip install pandasql && \ | |
@@ -392,8 +388,7 @@ RUN pip install flashtext && \ | |||
| 392 | 388 | pip install plotly_express && \ | |
| 393 | 389 | pip install albumentations && \ | |
| 394 | 390 | pip install catalyst && \ | |
| 395 | - # b/162850432 prevent matplotlib upgrade. | ||
| 396 | - pip install osmnx==0.15.1 && \ | ||
| 391 | + pip install osmnx && \ | ||
| 397 | 392 | apt-get -y install libspatialindex-dev && \ | |
| 398 | 393 | pip install pytorch-ignite && \ | |
| 399 | 394 | pip install qgrid && \ | |
@@ -478,9 +473,7 @@ ADD patches/imagemagick-policy.xml /etc/ImageMagick-6/policy.xml | |||
| 478 | 473 | # Disable unnecessary jupyter extensions | |
| 479 | 474 | RUN jupyter-nbextension disable nb_conda --py --sys-prefix && \ | |
| 480 | 475 | jupyter-serverextension disable nb_conda --py --sys-prefix && \ | |
| 481 | - python -m nb_conda_kernels.install --disable && \ | ||
| 482 | - jupyter-nbextension disable nbpresent --py --sys-prefix && \ | ||
| 483 | - jupyter-serverextension disable nbpresent --py --sys-prefix | ||
| 476 | + python -m nb_conda_kernels.install --disable | ||
| 484 | 477 | ||
| 485 | 478 | # Set backend for matplotlib | |
| 486 | 479 | ENV MPLBACKEND "agg" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | ARG BASE_TAG=staging | |
| 2 | 2 | ||
| 3 | 3 | FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 AS nvidia | |
| 4 | - FROM gcr.io/kaggle-images/python-tensorflow-whl:2.4.0-py37 as tensorflow_whl | ||
| 4 | + FROM gcr.io/kaggle-images/python-tensorflow-whl:2.4.0-py37-2 as tensorflow_whl | ||
| 5 | 5 | FROM gcr.io/kaggle-images/python:${BASE_TAG} | |
| 6 | 6 | ||
| 7 | 7 | ADD clean-layer.sh /tmp/clean-layer.sh | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,4 +19,5 @@ | |||
| 19 | 19 | * `2.3.0-py37`: TensorFlow 2.3.0 with Python 3.7 | |
| 20 | 20 | * `2.3.1-py37`: TensorFlow 2.3.1 with Python 3.7 | |
| 21 | 21 | * `2.3.1-py37-2`: TensorFlow 2.3.1 & TFA 0.11 with Python 3.7 | |
| 22 | - * `2.4.0-py37`: TensorFlow 2.4.0 & Python 3.7 & TFA 0.12 | ||
| 22 | + * `2.4.0-py37`: TensorFlow 2.4.0 & Python 3.7 & TFA 0.12 | ||
| 23 | + * `2.4.0-py37-2`: TensorFlow 2.4.0 & m61 base image | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | FROM nvidia/cuda:10.2-cudnn7-devel-ubuntu18.04 AS nvidia | |
| 2 | - FROM gcr.io/deeplearning-platform-release/base-cpu:m46 | ||
| 2 | + FROM gcr.io/deeplearning-platform-release/base-cpu:m61 | ||
| 3 | 3 | ||
| 4 | 4 | # Avoid interactive configuration prompts/dialogs during apt-get. | |
| 5 | 5 | ENV DEBIAN_FRONTEND=noninteractive | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,8 +8,8 @@ | |||
| 8 | 8 | ||
| 9 | 9 | class TestTensorflow(unittest.TestCase): | |
| 10 | 10 | def test_addition(self): | |
| 11 | - result = tf.add(2, 3) | ||
| 12 | - self.assertEqual(5, result.numpy()) | ||
| 11 | + result = tf.add([1, 2], [3, 4]) | ||
| 12 | + self.assertEqual([2], result.shape) | ||
| 13 | 13 | ||
| 14 | 14 | def test_conv2d(self): | |
| 15 | 15 | input = tf.random.normal([1,2,2,1]) | |
@@ -66,7 +66,7 @@ def test_gpu(self): | |||
| 66 | 66 | m1 = tf.constant([2.0, 3.0], shape=[1, 2], name='a') | |
| 67 | 67 | m2 = tf.constant([3.0, 4.0], shape=[2, 1], name='b') | |
| 68 | 68 | result = tf.matmul(m1, m2) | |
| 69 | - self.assertEqual(np.array(18, dtype=np.float32, ndmin=2), result.numpy()) | ||
| 69 | + self.assertEqual([1, 1], result.shape) | ||
| 70 | 70 | ||
| 71 | 71 | @gpu_test | |
| 72 | 72 | def test_is_built_with_cuda(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ def test_tfa_image(self): | |||
| 11 | 11 | img = tf.image.convert_image_dtype(img, tf.float32) | |
| 12 | 12 | mean = tfa.image.mean_filter2d(img, filter_shape=1) | |
| 13 | 13 | ||
| 14 | - self.assertEqual(1, len(mean)) | ||
| 14 | + self.assertEqual([1, 1, 3], mean.shape) | ||
| 15 | 15 | ||
| 16 | 16 | # This test exercises TFA Custom Op. See: b/145555176 | |
| 17 | 17 | def test_gelu(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,30 @@ | |||
| 1 | + import unittest | ||
| 2 | + | ||
| 3 | + from tensorforce import Agent, Environment | ||
| 4 | + | ||
| 5 | + class TestTensorforce(unittest.TestCase): | ||
| 6 | + # based on https://github.com/tensorforce/tensorforce/tree/master#quickstart-example-code. | ||
| 7 | + def test_quickstart(self): | ||
| 8 | + environment = Environment.create( | ||
| 9 | + environment='gym', level='CartPole', max_episode_timesteps=500 | ||
| 10 | + ) | ||
| 11 | + | ||
| 12 | + agent = Agent.create( | ||
| 13 | + agent='tensorforce', | ||
| 14 | + environment=environment, # alternatively: states, actions, (max_episode_timesteps) | ||
| 15 | + memory=1000, | ||
| 16 | + update=dict(unit='timesteps', batch_size=32), | ||
| 17 | + optimizer=dict(type='adam', learning_rate=3e-4), | ||
| 18 | + policy=dict(network='auto'), | ||
| 19 | + objective='policy_gradient', | ||
| 20 | + reward_estimation=dict(horizon=1) | ||
| 21 | + ) | ||
| 22 | + | ||
| 23 | + # Train for a single episode. | ||
| 24 | + states = environment.reset() | ||
| 25 | + actions = agent.act(states=states) | ||
| 26 | + states, terminal, reward = environment.execute(actions=actions) | ||
| 27 | + | ||
| 28 | + self.assertEqual(4, len(states)) | ||
| 29 | + self.assertFalse(terminal) | ||
| 30 | + self.assertEqual(1, reward) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments