5e9835c
user_wwq 3 years ago
13 changed file(s) with 87 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
11 "cells": [
22 {
33 "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 ],
827 "source": [
928 "import tensorflow.compat.v1 as tf\n",
1029 "tf.disable_v2_behavior()\n",
1938 },
2039 {
2140 "cell_type": "code",
22 "execution_count": 10,
23 "id": "4e847a1f",
41 "execution_count": 4,
42 "id": "43c02554",
2443 "metadata": {},
2544 "outputs": [],
2645 "source": [
3150 },
3251 {
3352 "cell_type": "code",
34 "execution_count": 11,
35 "id": "a3ab7344",
53 "execution_count": 5,
54 "id": "f46eb227",
3655 "metadata": {},
3756 "outputs": [],
3857 "source": [
4968 {
5069 "cell_type": "code",
5170 "execution_count": 12,
52 "id": "491be63a",
71 "id": "023f6e63",
5372 "metadata": {},
5473 "outputs": [],
5574 "source": [
5675 "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",
5877 " img_p = src.util.preprocess_images_outpainting(img)\n",
5978 " return img_p"
6079 ]
6180 },
6281 {
6382 "cell_type": "code",
64 "execution_count": 13,
65 "id": "ac6e19b7",
83 "execution_count": 7,
84 "id": "7d9b6be5",
6685 "metadata": {},
6786 "outputs": [],
6887 "source": [
7594 },
7695 {
7796 "cell_type": "code",
78 "execution_count": 14,
79 "id": "54877357",
97 "execution_count": 8,
98 "id": "46e6b624",
8099 "metadata": {},
81100 "outputs": [],
82101 "source": [
97116 },
98117 {
99118 "cell_type": "code",
100 "execution_count": 15,
101 "id": "15a5515c",
119 "execution_count": 10,
120 "id": "f93744f9",
102121 "metadata": {},
103122 "outputs": [],
104123 "source": [
121140 },
122141 {
123142 "cell_type": "code",
124 "execution_count": 16,
125 "id": "93cf5ae7",
143 "execution_count": 13,
144 "id": "c70f1f59",
126145 "metadata": {},
127146 "outputs": [
128147 {
129148 "name": "stdout",
130149 "output_type": "stream",
131150 "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"
134182 ]
135183 },
136184 {
137185 "data": {
138186 "text/plain": [
139 "{'Output': '/home/jovyan/work/results/test_output.png'}"
187 "{'Output': './results/test_output.png'}"
140188 ]
141189 },
142 "execution_count": 16,
190 "execution_count": 13,
143191 "metadata": {},
144192 "output_type": "execute_result"
145193 }
2121 return inner
2222
2323 def load_demo_image(in_PATH):
24 img = np.array(Image.open(in_PATH).convert('RGB'))[np.newaxis] / 255.0
24 img = np.array(Image.open(in_PATH).resize((128, 128), Image.ANTIALIAS).convert('RGB'))[np.newaxis] / 255.0
2525 img_p = src.util.preprocess_images_outpainting(img)
2626 return img_p
2727
5959 res = inference(model_PATH, image)
6060 image_str = image_to_path(res)
6161 return {'Output': image_str}
62
62
63
64 handle({'Photo': '/home/jovyan/work/images/test.png'})
66 2022-06-27T06:34:38.468014128Z Imported model (for Places365, 128x128 images)
77 2022-06-27T06:34:43.13214278Z Usage: python test.py [model_PATH] [in_PATH] [out_PATH]
88 2022-06-27T06:34:43.648430148Z SYSTEM: Finishing...
9 2022-06-27T06:34:43.856538313Z SYSTEM: Done!
1111 2022-06-27T06:35:20.69064768Z with tf.variable_scope('G', reuse=tf.AUTO_REUSE):
1212 2022-06-27T06:35:20.690694567Z AttributeError: module 'tensorflow' has no attribute 'variable_scope'
1313 2022-06-27T06:35:21.152841351Z SYSTEM: Finishing...
14 2022-06-27T06:35:21.360045607Z SYSTEM: Error Exists!
125125 2022-06-27T06:36:16.867625257Z self._traceback = tf_stack.extract_stack()
126126 2022-06-27T06:36:16.86762792Z
127127 2022-06-27T06:36:17.563235506Z SYSTEM: Finishing...
128 2022-06-27T06:36:17.774827082Z SYSTEM: Error Exists!
6464 2022-06-27T06:38:22.386423007Z checkpoint_prefix)
6565 2022-06-27T06:38:22.386428006Z ValueError: The passed save_path is not a valid checkpoint: /home/jovyan/work/src/output/models/
6666 2022-06-27T06:38:23.059942491Z SYSTEM: Finishing...
67 2022-06-27T06:38:23.293018249Z SYSTEM: Error Exists!
6868 2022-06-27T06:39:44.071457371Z fp = builtins.open(filename, "w+b")
6969 2022-06-27T06:39:44.071493873Z IsADirectoryError: [Errno 21] Is a directory: '/home/jovyan/work/results/'
7070 2022-06-27T06:39:45.129121047Z SYSTEM: Finishing...
71 2022-06-27T06:39:45.330379438Z SYSTEM: Error Exists!
6060 2022-06-27T06:40:35.830526984Z 2022-06-27 14:40:35.825663: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudnn.so.7
6161 2022-06-27T06:40:37.078582913Z 2022-06-27 14:40:37.071379: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcublas.so.10
6262 2022-06-27T06:40:39.337113298Z SYSTEM: Finishing...
63 2022-06-27T06:40:39.545743808Z SYSTEM: Done!
6060 2022-06-27T08:48:16.324801304Z 2022-06-27 16:48:16.323386: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudnn.so.7
6161 2022-06-27T08:48:17.556743331Z 2022-06-27 16:48:17.551710: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcublas.so.10
6262 2022-06-27T08:48:19.783798978Z SYSTEM: Finishing...
63 2022-06-27T08:48:20.006397102Z SYSTEM: Done!
1212 2022-06-27T08:53:59.436729791Z File "<__array_function__ internals>", line 6, in concatenate
1313 2022-06-27T08:53:59.443505289Z ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 250 and the array at index 1 has size 128
1414 2022-06-27T08:53:59.902211373Z SYSTEM: Finishing...
15 2022-06-27T08:54:00.105456185Z SYSTEM: Error Exists!
6060 2022-06-27T08:57:53.434540742Z 2022-06-27 16:57:53.425442: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudnn.so.7
6161 2022-06-27T08:57:54.72057696Z 2022-06-27 16:57:54.713817: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcublas.so.10
6262 2022-06-27T08:57:57.027310115Z SYSTEM: Finishing...
63 2022-06-27T08:57:57.238472655Z SYSTEM: Done!
0 2022-07-10T14:30:36.271615712Z SYSTEM: Preparing env...
1 2022-07-10T14:30:36.614304501Z script path /home/jovyan/work/src/eval_DAVIS.py not exists
0 2022-07-10T14:31:21.705751641Z SYSTEM: Preparing env...
1 2022-07-10T14:31:22.044666538Z script path /home/jovyan/work/src/eval_DAVIS.py not exists