From 3be503337f58e16ef6e90e00449354ba4c262897 Mon Sep 17 00:00:00 2001
From: Markus Fleischhacker
Date: Sun, 7 Mar 2021 08:17:22 +0100
Subject: [PATCH] Upgrade to libtorch v1.8.0 in CMake scripts and Dockerfile,
update CUDA version in colab notebook, update readme. (#78)
---
CMakeLists.txt | 2 +-
Dockerfile | 4 +-
README.md | 12 +-
cmake/fetch_libtorch.cmake | 16 +-
notebooks/pytorch_cpp_colab_notebook.ipynb | 281 ++++++---------------
5 files changed, 91 insertions(+), 224 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0c02672..e361f0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(DOWNLOAD_DATASETS "Automatically download required datasets at build-time." ON)
option(CREATE_SCRIPTMODULES "Automatically create all required scriptmodule files at build-time (requires python3)." OFF)
-set(PYTORCH_VERSION "1.7.0")
+set(PYTORCH_VERSION "1.8.0")
find_package(Torch ${PYTORCH_VERSION} EXACT QUIET PATHS "${CMAKE_SOURCE_DIR}/libtorch")
diff --git a/Dockerfile b/Dockerfile
index c90566e..6019851 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -31,8 +31,8 @@ RUN curl --silent --show-error --location --output ~/miniconda.sh https://repo.a
FROM conda AS conda-installs
# Install pytorch for CPU and torchvision.
-ARG PYTORCH_VERSION=1.6.0
-ARG TORCHVISION_VERSION=0.7.0
+ARG PYTORCH_VERSION=1.8.0
+ARG TORCHVISION_VERSION=0.9.0
ENV NO_CUDA=1
RUN conda install pytorch==${PYTORCH_VERSION} torchvision==${TORCHVISION_VERSION} cpuonly -y -c pytorch && conda clean -ya
diff --git a/README.md b/README.md
index 0007bec..651422f 100644
--- a/README.md
+++ b/README.md
@@ -6,12 +6,12 @@
-
+
-| OS (Compiler)\\LibTorch | 1.7.0 | nightly |
+| OS (Compiler)\\LibTorch | 1.8.0 | nightly |
| :---------------------: | :---------------------------------------------------------------------------------------------------: | :-----: |
| macOS (clang 9.1) | ![Status](https://travis-matrix-badges.herokuapp.com/repos/prabhuomkar/pytorch-cpp/branches/master/1) | |
| macOS (clang 10.0) | ![Status](https://travis-matrix-badges.herokuapp.com/repos/prabhuomkar/pytorch-cpp/branches/master/2) | |
@@ -58,7 +58,7 @@ This repository provides tutorial code in C++ for deep learning researchers to l
1. [C++](http://www.cplusplus.com/doc/tutorial/introduction/)
2. [CMake](https://cmake.org/download/) (minimum version 3.14)
-3. [LibTorch v1.7.0](https://pytorch.org/cppdocs/installing.html)
+3. [LibTorch v1.8.0](https://pytorch.org/cppdocs/installing.html)
4. [Conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html)
@@ -95,7 +95,7 @@ Some useful options:
| Option | Default | Description |
| :------------- |:------------|-----:|
-| `-D CUDA_V=(9.2 [Linux only]\|10.1\|10.2\|11.0\|none)` | `none` | Download LibTorch for a CUDA version (`none` = download CPU version). |
+| `-D CUDA_V=(\|10.2\|11.1\|none)` | `none` | Download LibTorch for a CUDA version (`none` = download CPU version). |
| `-D DOWNLOAD_DATASETS=(OFF\|ON)` | `ON` | Download required datasets during build (only if they do not already exist in `pytorch-cpp/data`). |
|`-D CREATE_SCRIPTMODULES=(OFF\|ON)` | `OFF` | Create all required scriptmodule files for prelearned models / weights during build. Requires installed python3 with pytorch and torchvision. |
| `-D CMAKE_PREFIX_PATH=path/to/libtorch/share/cmake/Torch` | `` | Skip the downloading of LibTorch and use your own local version (see [Requirements](#requirements)) instead. |
@@ -121,14 +121,14 @@ cmake -B build \
Example Windows
##### Aim
-* Automatically download LibTorch for CUDA 10.2 and all necessary datasets.
+* Automatically download LibTorch for CUDA 11.1 and all necessary datasets.
* Do not create scriptmodule files.
##### Command
```bash
cmake -B build \
-A x64 \
--D CUDA_V=10.2
+-D CUDA_V=11.1
```
diff --git a/cmake/fetch_libtorch.cmake b/cmake/fetch_libtorch.cmake
index 7ef8556..c1fc544 100644
--- a/cmake/fetch_libtorch.cmake
+++ b/cmake/fetch_libtorch.cmake
@@ -2,20 +2,16 @@ cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
include(FetchContent)
-set(CUDA_V "none" CACHE STRING "Determines libtorch CUDA version to download (9.2 [Linux only], 10.1, 10.2 or 11.0).")
+set(CUDA_V "none" CACHE STRING "Determines libtorch CUDA version to download (10.2, 11.1 or none).")
if(${CUDA_V} STREQUAL "none")
set(LIBTORCH_DEVICE "cpu")
-elseif(${CUDA_V} STREQUAL "9.2")
- set(LIBTORCH_DEVICE "cu92")
-elseif(${CUDA_V} STREQUAL "10.1")
- set(LIBTORCH_DEVICE "cu101")
elseif(${CUDA_V} STREQUAL "10.2")
set(LIBTORCH_DEVICE "cu102")
-elseif(${CUDA_V} STREQUAL "11.0")
- set(LIBTORCH_DEVICE "cu110")
+elseif(${CUDA_V} STREQUAL "11.1")
+ set(LIBTORCH_DEVICE "cu111")
else()
- message(FATAL_ERROR "Invalid CUDA version specified, must be 9.2 [Linux only], 10.1, 10.2, 11.0 or none!")
+ message(FATAL_ERROR "Invalid CUDA version specified, must be 10.2, 11.1 or none!")
endif()
if(NOT ${LIBTORCH_DEVICE} STREQUAL "cu102")
@@ -23,10 +19,6 @@ if(NOT ${LIBTORCH_DEVICE} STREQUAL "cu102")
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
- if(${LIBTORCH_DEVICE} STREQUAL "cu92")
- message(FATAL_ERROR "PyTorch ${PYTORCH_VERSION} does not support CUDA 9.2 on Windows. Please use CPU or upgrade to CUDA versions 10.1, 10.2 or 11.0.")
- endif()
-
set(LIBTORCH_URL "https://download.pytorch.org/libtorch/${LIBTORCH_DEVICE}/libtorch-win-shared-with-deps-${PYTORCH_VERSION}${LIBTORCH_DEVICE_TAG}.zip")
set(CMAKE_BUILD_TYPE "Release")
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
diff --git a/notebooks/pytorch_cpp_colab_notebook.ipynb b/notebooks/pytorch_cpp_colab_notebook.ipynb
index b7b1250..e3595c3 100644
--- a/notebooks/pytorch_cpp_colab_notebook.ipynb
+++ b/notebooks/pytorch_cpp_colab_notebook.ipynb
@@ -3,9 +3,9 @@
"nbformat_minor": 0,
"metadata": {
"colab": {
- "name": "Copy of pytorch_cpp_colab_notebook.ipynb",
- "provenance": [],
+ "name": "Copy of Copy of pytorch_cpp_colab_notebook.ipynb",
"private_outputs": true,
+ "provenance": [],
"collapsed_sections": [
"VbwYTgxWvfMD"
],
@@ -21,8 +21,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "VS2lCrJC55PX",
- "colab_type": "text"
+ "id": "VS2lCrJC55PX"
},
"source": [
"\n",
@@ -35,8 +34,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "2giT9_5csfEP",
- "colab_type": "text"
+ "id": "2giT9_5csfEP"
},
"source": [
"#Setup\n",
@@ -47,8 +45,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "ZTcewDy6cnxQ",
- "colab_type": "text"
+ "id": "ZTcewDy6cnxQ"
},
"source": [
"##Magics and Imports"
@@ -57,9 +54,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "s7-GsT7v-TAh",
- "colab_type": "code",
- "colab": {}
+ "id": "s7-GsT7v-TAh"
},
"source": [
"# For nicer looking images\n",
@@ -82,9 +77,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "2ASwLgYo3AkT",
- "colab_type": "code",
- "colab": {}
+ "id": "2ASwLgYo3AkT"
},
"source": [
"# Image plotting helper function\n",
@@ -142,8 +135,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "cs1nFZkH59Nb",
- "colab_type": "text"
+ "id": "cs1nFZkH59Nb"
},
"source": [
"##Install more recent CMake Version"
@@ -152,9 +144,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "m2Lf4RSjou6t",
- "colab_type": "code",
- "colab": {}
+ "id": "m2Lf4RSjou6t"
},
"source": [
"!rm -rf deps\n",
@@ -175,8 +165,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "ZCawMy0erYiQ",
- "colab_type": "text"
+ "id": "ZCawMy0erYiQ"
},
"source": [
"##Installed Programs & GPU"
@@ -185,9 +174,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "pMMGmOVmra8B",
- "colab_type": "code",
- "colab": {}
+ "id": "pMMGmOVmra8B"
},
"source": [
"%%bash\n",
@@ -211,8 +198,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "saxZiiBKsjbj",
- "colab_type": "text"
+ "id": "saxZiiBKsjbj"
},
"source": [
"##Clone Repo"
@@ -221,9 +207,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "pYr7GTcGsnvx",
- "colab_type": "code",
- "colab": {}
+ "id": "pYr7GTcGsnvx"
},
"source": [
"!git clone https://github.com/prabhuomkar/pytorch-cpp.git\n",
@@ -236,8 +220,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "Jso4xNoBtRsk",
- "colab_type": "text"
+ "id": "Jso4xNoBtRsk"
},
"source": [
"##Generate Build System"
@@ -246,13 +229,11 @@
{
"cell_type": "code",
"metadata": {
- "id": "rbeD5lKStWhS",
- "colab_type": "code",
- "colab": {}
+ "id": "rbeD5lKStWhS"
},
"source": [
"%rm -rf build\n",
- "!cmake -B build -D CUDA_V=10.1 -D CMAKE_BUILD_TYPE=Release"
+ "!cmake -B build -D CUDA_V=11.1 -D CMAKE_BUILD_TYPE=Release"
],
"execution_count": null,
"outputs": []
@@ -260,8 +241,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "YOqr6Z6Mt5y9",
- "colab_type": "text"
+ "id": "YOqr6Z6Mt5y9"
},
"source": [
"##Build Tutorials"
@@ -270,9 +250,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "H-n_1d4Mt8MG",
- "colab_type": "code",
- "colab": {}
+ "id": "H-n_1d4Mt8MG"
},
"source": [
"!cmake --build build"
@@ -283,8 +261,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "YRgm8b_yvZyQ",
- "colab_type": "text"
+ "id": "YRgm8b_yvZyQ"
},
"source": [
"#Run Tutorials\n",
@@ -312,8 +289,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "VbwYTgxWvfMD",
- "colab_type": "text"
+ "id": "VbwYTgxWvfMD"
},
"source": [
"##Basics"
@@ -322,9 +298,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "U1S-Iruk0GAB",
- "colab_type": "code",
- "colab": {}
+ "id": "U1S-Iruk0GAB"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/basics/ -1"
@@ -335,8 +309,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "OVBcBgknvm_W",
- "colab_type": "text"
+ "id": "OVBcBgknvm_W"
},
"source": [
"### Pytorch-Basics"
@@ -345,9 +318,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "Ev7P19zzzRfu",
- "colab_type": "code",
- "colab": {}
+ "id": "Ev7P19zzzRfu"
},
"source": [
"# Create required torchscript module:\n",
@@ -360,9 +331,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "Z2pMypzTywYj",
- "colab_type": "code",
- "colab": {}
+ "id": "Z2pMypzTywYj"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/basics/pytorch_basics/"
@@ -373,9 +342,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "l4YOWqn2y_0G",
- "colab_type": "code",
- "colab": {}
+ "id": "l4YOWqn2y_0G"
},
"source": [
"# Run\n",
@@ -388,8 +355,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "eX6YN9DB04r2",
- "colab_type": "text"
+ "id": "eX6YN9DB04r2"
},
"source": [
"###Linear Regression"
@@ -398,9 +364,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "BPXFDYqO1DqW",
- "colab_type": "code",
- "colab": {}
+ "id": "BPXFDYqO1DqW"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/basics/linear_regression/"
@@ -411,9 +375,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "6agvmvVh1J7f",
- "colab_type": "code",
- "colab": {}
+ "id": "6agvmvVh1J7f"
},
"source": [
"# Run\n",
@@ -426,8 +388,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "3rfrwqKU1VZm",
- "colab_type": "text"
+ "id": "3rfrwqKU1VZm"
},
"source": [
"###Logistic Regression"
@@ -436,9 +397,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "mIBloL341Yis",
- "colab_type": "code",
- "colab": {}
+ "id": "mIBloL341Yis"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/basics/logistic_regression/"
@@ -449,9 +408,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "qkKPAWBk1d9V",
- "colab_type": "code",
- "colab": {}
+ "id": "qkKPAWBk1d9V"
},
"source": [
"# Run\n",
@@ -464,8 +421,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "ywmM2xkt1mi0",
- "colab_type": "text"
+ "id": "ywmM2xkt1mi0"
},
"source": [
"###Feedforward Neural Network"
@@ -474,9 +430,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "jZsPU07C1p-K",
- "colab_type": "code",
- "colab": {}
+ "id": "jZsPU07C1p-K"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/basics/feedforward_neural_network/"
@@ -487,9 +441,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "DAgpSavJ1tjH",
- "colab_type": "code",
- "colab": {}
+ "id": "DAgpSavJ1tjH"
},
"source": [
"# Run\n",
@@ -502,8 +454,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "XFVlcoQKvhX3",
- "colab_type": "text"
+ "id": "XFVlcoQKvhX3"
},
"source": [
"##Intermediate"
@@ -512,9 +463,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "TVcLYosB16Xi",
- "colab_type": "code",
- "colab": {}
+ "id": "TVcLYosB16Xi"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/intermediate/ -1"
@@ -525,8 +474,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "2gjZC6b_2PEz",
- "colab_type": "text"
+ "id": "2gjZC6b_2PEz"
},
"source": [
"###Convolutional Neural Network"
@@ -535,9 +483,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "-ERzOw4F2ap1",
- "colab_type": "code",
- "colab": {}
+ "id": "-ERzOw4F2ap1"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/intermediate/convolutional_neural_network/"
@@ -548,9 +494,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "PygE27Dq2mUp",
- "colab_type": "code",
- "colab": {}
+ "id": "PygE27Dq2mUp"
},
"source": [
"# Run\n",
@@ -564,8 +508,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "Kla2SaVv228f",
- "colab_type": "text"
+ "id": "Kla2SaVv228f"
},
"source": [
"###Deep Residual Network"
@@ -574,9 +517,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "grh7dIl-2y_5",
- "colab_type": "code",
- "colab": {}
+ "id": "grh7dIl-2y_5"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/intermediate/deep_residual_network/"
@@ -587,9 +528,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "t6sxgY3U28Fj",
- "colab_type": "code",
- "colab": {}
+ "id": "t6sxgY3U28Fj"
},
"source": [
"# Run\n",
@@ -603,8 +542,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "aTrOcUke3Zxu",
- "colab_type": "text"
+ "id": "aTrOcUke3Zxu"
},
"source": [
"###Recurrent Neural Network"
@@ -613,9 +551,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "m2C4zWx_3iyM",
- "colab_type": "code",
- "colab": {}
+ "id": "m2C4zWx_3iyM"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/intermediate/recurrent_neural_network/"
@@ -626,9 +562,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "xqEYhxql3qKr",
- "colab_type": "code",
- "colab": {}
+ "id": "xqEYhxql3qKr"
},
"source": [
"# Run\n",
@@ -642,8 +576,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "FVVx0XFY3yvU",
- "colab_type": "text"
+ "id": "FVVx0XFY3yvU"
},
"source": [
"###Bidirectional Recurrent Neural Network"
@@ -652,9 +585,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "XwKsI8Cc315L",
- "colab_type": "code",
- "colab": {}
+ "id": "XwKsI8Cc315L"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/intermediate/bidirectional_recurrent_neural_network/"
@@ -665,9 +596,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "GvZmNxTr34eM",
- "colab_type": "code",
- "colab": {}
+ "id": "GvZmNxTr34eM"
},
"source": [
"# Run\n",
@@ -681,8 +610,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "gnvBsukO4H00",
- "colab_type": "text"
+ "id": "gnvBsukO4H00"
},
"source": [
"###Language Model\n"
@@ -691,9 +619,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "mvKxwskb4K81",
- "colab_type": "code",
- "colab": {}
+ "id": "mvKxwskb4K81"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/intermediate/language_model/"
@@ -704,9 +630,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "RcHpHp3-4OMw",
- "colab_type": "code",
- "colab": {}
+ "id": "RcHpHp3-4OMw"
},
"source": [
"# Run\n",
@@ -720,9 +644,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "u8sZ3Wk2720U",
- "colab_type": "code",
- "colab": {}
+ "id": "u8sZ3Wk2720U"
},
"source": [
"# Results\n",
@@ -734,8 +656,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "hJS5K-6rvjkW",
- "colab_type": "text"
+ "id": "hJS5K-6rvjkW"
},
"source": [
"##Advanced"
@@ -744,9 +665,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "xZKTaitM4e9L",
- "colab_type": "code",
- "colab": {}
+ "id": "xZKTaitM4e9L"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/advanced/"
@@ -757,8 +676,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "ggBdsvyR8UMN",
- "colab_type": "text"
+ "id": "ggBdsvyR8UMN"
},
"source": [
"###Generative Adversarial Network"
@@ -767,9 +685,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "t3ehQI_O8bEM",
- "colab_type": "code",
- "colab": {}
+ "id": "t3ehQI_O8bEM"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/advanced/generative_adversarial_network/"
@@ -780,9 +696,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "xPKI6qSw8n2F",
- "colab_type": "code",
- "colab": {}
+ "id": "xPKI6qSw8n2F"
},
"source": [
"# Run\n",
@@ -796,9 +710,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "CQ7Dt6dr9Hug",
- "colab_type": "code",
- "colab": {}
+ "id": "CQ7Dt6dr9Hug"
},
"source": [
"# Results\n",
@@ -812,9 +724,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "LDZDvBUALJtw",
- "colab_type": "code",
- "colab": {}
+ "id": "LDZDvBUALJtw"
},
"source": [
"# Show results:\n",
@@ -832,8 +742,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "CYzbCRPo_TJ7",
- "colab_type": "text"
+ "id": "CYzbCRPo_TJ7"
},
"source": [
"###Variational Autoencoder"
@@ -842,9 +751,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "qP1x5N6PFLw5",
- "colab_type": "code",
- "colab": {}
+ "id": "qP1x5N6PFLw5"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/advanced/variational_autoencoder/"
@@ -855,9 +762,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "Y2PHWLYVFXR5",
- "colab_type": "code",
- "colab": {}
+ "id": "Y2PHWLYVFXR5"
},
"source": [
"# Run\n",
@@ -871,9 +776,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "szHaGKCfFsju",
- "colab_type": "code",
- "colab": {}
+ "id": "szHaGKCfFsju"
},
"source": [
"# Results\n",
@@ -887,9 +790,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "elkk38xaGJLU",
- "colab_type": "code",
- "colab": {}
+ "id": "elkk38xaGJLU"
},
"source": [
"vae_output_file_paths = sorted(list(Path(\"./output\").iterdir()), key=os.path.getmtime)\n",
@@ -904,8 +805,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "ix6R5AosZHTx",
- "colab_type": "text"
+ "id": "ix6R5AosZHTx"
},
"source": [
"###Neural Style Transfer"
@@ -914,9 +814,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "IaEqJbsXZjBD",
- "colab_type": "code",
- "colab": {}
+ "id": "IaEqJbsXZjBD"
},
"source": [
"# Create required torchscript module:\n",
@@ -929,9 +827,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "x-oKRmdZZSbz",
- "colab_type": "code",
- "colab": {}
+ "id": "x-oKRmdZZSbz"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/advanced/neural_style_transfer/"
@@ -942,9 +838,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "bPrnqcFvZXJU",
- "colab_type": "code",
- "colab": {}
+ "id": "bPrnqcFvZXJU"
},
"source": [
"# Run\n",
@@ -958,9 +852,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "Eo8v_9s9eUvR",
- "colab_type": "code",
- "colab": {}
+ "id": "Eo8v_9s9eUvR"
},
"source": [
"# Results\n",
@@ -972,9 +864,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "7RW9fPEyfus8",
- "colab_type": "code",
- "colab": {}
+ "id": "7RW9fPEyfus8"
},
"source": [
"# Inputs\n",
@@ -986,9 +876,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "vSJXkbn2hcgK",
- "colab_type": "code",
- "colab": {}
+ "id": "vSJXkbn2hcgK"
},
"source": [
"nst_input_file_paths = sorted(list(Path(\"/content/pytorch-cpp/data/neural_style_transfer_images\").iterdir()))\n",
@@ -1001,9 +889,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "Qhyn-FrkekZa",
- "colab_type": "code",
- "colab": {}
+ "id": "Qhyn-FrkekZa"
},
"source": [
"nst_output_file_paths = sorted(list(Path(\"/content/pytorch-cpp/build/tutorials/advanced/neural_style_transfer/output\").iterdir()), key=os.path.getmtime)\n",
@@ -1016,8 +902,7 @@
{
"cell_type": "markdown",
"metadata": {
- "id": "aEBcqiKr-5Sb",
- "colab_type": "text"
+ "id": "aEBcqiKr-5Sb"
},
"source": [
"###Image Captioning"
@@ -1026,9 +911,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "s-sgAqiJiGEC",
- "colab_type": "code",
- "colab": {}
+ "id": "s-sgAqiJiGEC"
},
"source": [
"# Create required torchscript module:\n",
@@ -1041,9 +924,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "VltI7w1tAuJt",
- "colab_type": "code",
- "colab": {}
+ "id": "VltI7w1tAuJt"
},
"source": [
"%ls /content/pytorch-cpp/build/tutorials/advanced/image_captioning/"
@@ -1054,9 +935,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "95UQmwSSBA4X",
- "colab_type": "code",
- "colab": {}
+ "id": "95UQmwSSBA4X"
},
"source": [
"# Show command line arguments:\n",
@@ -1069,9 +948,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "APa5ygazA1aw",
- "colab_type": "code",
- "colab": {}
+ "id": "APa5ygazA1aw"
},
"source": [
"# Run\n",
@@ -1085,9 +962,7 @@
{
"cell_type": "code",
"metadata": {
- "id": "Do8Q7qzxBINd",
- "colab_type": "code",
- "colab": {}
+ "id": "Do8Q7qzxBINd"
},
"source": [
"# Results\n",