forked from google-research/google-research
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding the compatibility with python 3 and TF2. Providing a docker fi…
…le for training the model on GPU. Edit the run_local_gpu.sh with the location of your dataset. PiperOrigin-RevId: 291449218
- Loading branch information
1 parent
7157071
commit 3d912f3
Showing
12 changed files
with
86 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# --- Template docker image | ||
FROM nvidia/cuda:10.0-cudnn7-runtime | ||
|
||
# --- system packages (not in nvidia image) | ||
RUN apt-get update | ||
RUN apt-get -y install python3 | ||
RUN apt-get -y install python3-pip | ||
|
||
# --- (unclear why necessary) | ||
WORKDIR /root | ||
|
||
# --- Installs packages | ||
RUN pip3 install --upgrade pip | ||
RUN pip3 install numpy | ||
RUN pip3 install matplotlib | ||
RUN pip3 install absl-py | ||
RUN pip3 install tqdm | ||
RUN pip3 install tensorflow-gpu==2.0.0-alpha0 | ||
|
||
# --- Copies the source code | ||
RUN mkdir /root/capsule_em | ||
COPY ./*.py /root/capsule_em/ | ||
COPY ./norb/ /root/capsule_em/norb/ | ||
COPY ./mnist/ /root/capsule_em/mnist/ | ||
|
||
# --- Defines the entry point | ||
ENTRYPOINT ["python3", "-m", "capsule_em.experiment"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2020 The Google Research Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
JOB_NAME="norbcapsule_`date +"%b%d_%H%M%S"`" | ||
TAG="norbcapsule_local_gpu" | ||
|
||
docker build -f DockerfileGPU -t $TAG $PWD | ||
docker run -v \ | ||
$HOME/datasets/smallNORB:/root/datasets/smallNORB \ | ||
--runtime=nvidia $TAG \ | ||
--job_name $JOB_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters