| 1 | 1 |
"cells": [
|
| 2 | 2 |
{
|
| 3 | 3 |
"cell_type": "code",
|
| 4 | |
"execution_count": 9,
|
| 5 | |
"id": "e5ad7f34",
|
| 6 | |
"metadata": {},
|
| 7 | |
"outputs": [],
|
|
4 |
"execution_count": 2,
|
|
5 |
"id": "627fe309",
|
|
6 |
"metadata": {},
|
|
7 |
"outputs": [
|
|
8 |
{
|
|
9 |
"name": "stderr",
|
|
10 |
"output_type": "stream",
|
|
11 |
"text": [
|
|
12 |
"2022-07-11 18:02:37.037995: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory\n",
|
|
13 |
"2022-07-11 18:02:37.038035: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.\n"
|
|
14 |
]
|
|
15 |
},
|
|
16 |
{
|
|
17 |
"name": "stdout",
|
|
18 |
"output_type": "stream",
|
|
19 |
"text": [
|
|
20 |
"WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/tensorflow/python/compat/v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.\n",
|
|
21 |
"Instructions for updating:\n",
|
|
22 |
"non-resource variables are not supported in the long term\n",
|
|
23 |
"Imported model (for Places365, 128x128 images)\n"
|
|
24 |
]
|
|
25 |
}
|
|
26 |
],
|
| 8 | 27 |
"source": [
|
| 9 | 28 |
"import tensorflow.compat.v1 as tf\n",
|
| 10 | 29 |
"tf.disable_v2_behavior()\n",
|
|
| 19 | 38 |
},
|
| 20 | 39 |
{
|
| 21 | 40 |
"cell_type": "code",
|
| 22 | |
"execution_count": 10,
|
| 23 | |
"id": "4e847a1f",
|
|
41 |
"execution_count": 4,
|
|
42 |
"id": "43c02554",
|
| 24 | 43 |
"metadata": {},
|
| 25 | 44 |
"outputs": [],
|
| 26 | 45 |
"source": [
|
|
| 31 | 50 |
},
|
| 32 | 51 |
{
|
| 33 | 52 |
"cell_type": "code",
|
| 34 | |
"execution_count": 11,
|
| 35 | |
"id": "a3ab7344",
|
|
53 |
"execution_count": 5,
|
|
54 |
"id": "f46eb227",
|
| 36 | 55 |
"metadata": {},
|
| 37 | 56 |
"outputs": [],
|
| 38 | 57 |
"source": [
|
|
| 49 | 68 |
{
|
| 50 | 69 |
"cell_type": "code",
|
| 51 | 70 |
"execution_count": 12,
|
| 52 | |
"id": "491be63a",
|
|
71 |
"id": "023f6e63",
|
| 53 | 72 |
"metadata": {},
|
| 54 | 73 |
"outputs": [],
|
| 55 | 74 |
"source": [
|
| 56 | 75 |
"def load_demo_image(in_PATH):\n",
|
| 57 | |
" img = np.array(Image.open(in_PATH).convert('RGB'))[np.newaxis] / 255.0\n",
|
|
76 |
" img = np.array(Image.open(in_PATH).resize((128, 128), Image.ANTIALIAS).convert('RGB'))[np.newaxis] / 255.0\n",
|
| 58 | 77 |
" img_p = src.util.preprocess_images_outpainting(img)\n",
|
| 59 | 78 |
" return img_p"
|
| 60 | 79 |
]
|
| 61 | 80 |
},
|
| 62 | 81 |
{
|
| 63 | 82 |
"cell_type": "code",
|
| 64 | |
"execution_count": 13,
|
| 65 | |
"id": "ac6e19b7",
|
|
83 |
"execution_count": 7,
|
|
84 |
"id": "7d9b6be5",
|
| 66 | 85 |
"metadata": {},
|
| 67 | 86 |
"outputs": [],
|
| 68 | 87 |
"source": [
|
|
| 75 | 94 |
},
|
| 76 | 95 |
{
|
| 77 | 96 |
"cell_type": "code",
|
| 78 | |
"execution_count": 14,
|
| 79 | |
"id": "54877357",
|
|
97 |
"execution_count": 8,
|
|
98 |
"id": "46e6b624",
|
| 80 | 99 |
"metadata": {},
|
| 81 | 100 |
"outputs": [],
|
| 82 | 101 |
"source": [
|
|
| 97 | 116 |
},
|
| 98 | 117 |
{
|
| 99 | 118 |
"cell_type": "code",
|
| 100 | |
"execution_count": 15,
|
| 101 | |
"id": "15a5515c",
|
|
119 |
"execution_count": 10,
|
|
120 |
"id": "f93744f9",
|
| 102 | 121 |
"metadata": {},
|
| 103 | 122 |
"outputs": [],
|
| 104 | 123 |
"source": [
|
|
| 121 | 140 |
},
|
| 122 | 141 |
{
|
| 123 | 142 |
"cell_type": "code",
|
| 124 | |
"execution_count": 16,
|
| 125 | |
"id": "93cf5ae7",
|
|
143 |
"execution_count": 13,
|
|
144 |
"id": "c70f1f59",
|
| 126 | 145 |
"metadata": {},
|
| 127 | 146 |
"outputs": [
|
| 128 | 147 |
{
|
| 129 | 148 |
"name": "stdout",
|
| 130 | 149 |
"output_type": "stream",
|
| 131 | 150 |
"text": [
|
| 132 | |
"INFO:tensorflow:Restoring parameters from /home/jovyan/work/src/output/models/model2000.ckpt\n",
|
| 133 | |
"Runned time: 0.317 s\n"
|
|
151 |
"WARNING:tensorflow:From /home/jovyan/work/src/model.py:20: conv2d (from tensorflow.python.keras.legacy_tf_layers.convolutional) is deprecated and will be removed in a future version.\n",
|
|
152 |
"Instructions for updating:\n",
|
|
153 |
"Use `tf.keras.layers.Conv2D` instead.\n",
|
|
154 |
"WARNING:tensorflow:From /usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/legacy_tf_layers/convolutional.py:424: Layer.apply (from tensorflow.python.keras.engine.base_layer_v1) is deprecated and will be removed in a future version.\n",
|
|
155 |
"Instructions for updating:\n",
|
|
156 |
"Please use `layer.__call__` method instead.\n",
|
|
157 |
"WARNING:tensorflow:From /home/jovyan/work/src/model.py:79: conv2d_transpose (from tensorflow.python.keras.legacy_tf_layers.convolutional) is deprecated and will be removed in a future version.\n",
|
|
158 |
"Instructions for updating:\n",
|
|
159 |
"Use `tf.keras.layers.Conv2DTranspose` instead.\n",
|
|
160 |
"INFO:tensorflow:Restoring parameters from ./src/output/models/model2000.ckpt\n"
|
|
161 |
]
|
|
162 |
},
|
|
163 |
{
|
|
164 |
"name": "stderr",
|
|
165 |
"output_type": "stream",
|
|
166 |
"text": [
|
|
167 |
"2022-07-11 18:03:35.362439: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory\n",
|
|
168 |
"2022-07-11 18:03:35.362468: W tensorflow/stream_executor/cuda/cuda_driver.cc:312] failed call to cuInit: UNKNOWN ERROR (303)\n",
|
|
169 |
"2022-07-11 18:03:35.362489: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (notebook): /proc/driver/nvidia/version does not exist\n",
|
|
170 |
"2022-07-11 18:03:35.362763: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA\n",
|
|
171 |
"To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
|
|
172 |
"2022-07-11 18:03:35.385100: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2500000000 Hz\n",
|
|
173 |
"2022-07-11 18:03:35.399501: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x60885a0 initialized for platform Host (this does not guarantee that XLA will be used). Devices:\n",
|
|
174 |
"2022-07-11 18:03:35.399527: I tensorflow/compiler/xla/service/service.cc:176] StreamExecutor device (0): Host, Default Version\n"
|
|
175 |
]
|
|
176 |
},
|
|
177 |
{
|
|
178 |
"name": "stdout",
|
|
179 |
"output_type": "stream",
|
|
180 |
"text": [
|
|
181 |
"Runned time: 4.791 s\n"
|
| 134 | 182 |
]
|
| 135 | 183 |
},
|
| 136 | 184 |
{
|
| 137 | 185 |
"data": {
|
| 138 | 186 |
"text/plain": [
|
| 139 | |
"{'Output': '/home/jovyan/work/results/test_output.png'}"
|
|
187 |
"{'Output': './results/test_output.png'}"
|
| 140 | 188 |
]
|
| 141 | 189 |
},
|
| 142 | |
"execution_count": 16,
|
|
190 |
"execution_count": 13,
|
| 143 | 191 |
"metadata": {},
|
| 144 | 192 |
"output_type": "execute_result"
|
| 145 | 193 |
}
|