質問編集履歴

2

元に戻した

2022/02/09 21:51

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -20,35 +20,21 @@
20
20
 
21
21
  Traceback (most recent call last):
22
22
 
23
- File "hdrcnn_predict4.py", line 77, in <module>
23
+ File "hdrcnn_predict5.py", line 77, in <module>
24
24
 
25
25
  net = network.model(x)
26
26
 
27
- File "/Users/****/hdrcnn/hdrcnn-master/network.py", line 50, in model
27
+ File "/Users/****/hdrcnn/hdrcnn-master/network.py", line 16, in model
28
-
28
+
29
- net_in = tl.layers.Input(tf.shape(x_in), name='input_layer')(x_in)
29
+ net_in = tl.layers.InputLayer(x_in, name='input_layer')
30
-
30
+
31
- File "/Users/****/Library/Python/3.7/lib/python/site-packages/tensorlayer/layers/inputs.py", line 83, in Input
31
+ File "/Users/****/Library/Python/3.7/lib/python/site-packages/tensorlayer/layers/deprecated.py", line 178, in InputLayer
32
-
33
- input_layer = _InputLayer(shape, dtype=dtype, name=name)
32
+
34
-
35
- File "/Users/****/Library/Python/3.7/lib/python/site-packages/tensorlayer/layers/inputs.py", line 46, in __init__
33
+ raise NonExistingLayerError("InputLayer(x, name='a') --> Input(name='a')(x)" + __log__)
36
-
37
- shape_without_none = [_ if _ is not None else 1 for _ in shape]
34
+
38
-
39
- File "/Users/****/Library/Python/3.7/lib/python/site-packages/tensorflow/python/framework/ops.py", line 520, in __iter__
40
-
41
- self._disallow_iteration()
42
-
43
- File "/Users/****/Library/Python/3.7/lib/python/site-packages/tensorflow/python/framework/ops.py", line 516, in _disallow_iteration
44
-
45
- self._disallow_in_graph_mode("iterating over `tf.Tensor`")
46
-
47
- File "/Users/****/Library/Python/3.7/lib/python/site-packages/tensorflow/python/framework/ops.py", line 496, in _disallow_in_graph_mode
48
-
49
- " this function with @tf.function.".format(task))
50
-
51
- tensorflow.python.framework.errors_impl.OperatorNotAllowedInGraphError: iterating over `tf.Tensor` is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.
35
+ tensorlayer.layers.deprecated.NonExistingLayerError: InputLayer(x, name='a') --> Input(name='a')(x)
36
+
37
+ Hint: 1) downgrade TF and TL from version 2.x to 1.x. 2) check the documentation of TF and TL version 2.x
52
38
 
53
39
  ```
54
40
 
@@ -60,14 +46,6 @@
60
46
 
61
47
 
62
48
 
63
- #hdrcnn_predict.py
64
-
65
- #Copyright (c) 2017, Gabriel Eilertsen.
66
-
67
- #All rights reserved.
68
-
69
-
70
-
71
49
  import os, sys
72
50
 
73
51
  import tensorflow.compat.v1 as tf
@@ -116,6 +94,10 @@
116
94
 
117
95
 
118
96
 
97
+
98
+
99
+ #設定、TensorFlow引数を使用
100
+
119
101
  FLAGS = tf.flags.FLAGS
120
102
 
121
103
  tf.flags.DEFINE_integer("width", "1024", "Reconstruction image width")
@@ -136,6 +118,10 @@
136
118
 
137
119
 
138
120
 
121
+ #32の倍数に丸めて、オートエンコーダのプーリングとアップサンプリングを行う
122
+
123
+ #入力画像と同じサイズになります
124
+
139
125
  sx = int(np.maximum(32, np.round(FLAGS.width/32.0)*32))
140
126
 
141
127
  sy = int(np.maximum(32, np.round(FLAGS.height/32.0)*32))
@@ -150,6 +136,36 @@
150
136
 
151
137
 
152
138
 
139
+ #情報
140
+
141
+ print_("\n\n\t-------------------------------------------------------------------\n", 'm')
142
+
143
+ print_("\t ディープCNNを使用した単一露光からのHDR画像再構成\n\n", 'm')
144
+
145
+ print_("\t 予測設定\n", 'm')
146
+
147
+ print_("\t -------------------\n", 'm')
148
+
149
+ print_("\t 入力画像のディレクトリ/ファイル:%s\n" % FLAGS.im_dir, 'm')
150
+
151
+ print_("\t 出力ディレクトリ:%s\n" % FLAGS.out_dir, 'm')
152
+
153
+ print_("\t CNN重み:%s\n" % FLAGS.params, 'm')
154
+
155
+ print_("\t 予測解像度: %dx%d ピクセル\n" % (sx, sy), 'm')
156
+
157
+ if FLAGS.scaling > 1.0:
158
+
159
+ print_("\t Pre-scaling: %0.4f\n" % FLAGS.scaling, 'm')
160
+
161
+ if FLAGS.gamma > 1.0 + eps or FLAGS.gamma < 1.0 - eps:
162
+
163
+ print_("\t Gamma: %0.4f\n" % FLAGS.gamma, 'm')
164
+
165
+ print_("\t-------------------------------------------------------------------\n\n\n", 'm')
166
+
167
+
168
+
153
169
  # シングルフレーム
154
170
 
155
171
  frames = [FLAGS.im_dir]

1

修正

2021/08/19 11:01

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,4 +1,4 @@
1
- 今TensorFlow1.*で書かれたプログラムをTensorFlow2.*で動作できるように変えています。
1
+ 今TensorFlow1.*で[書かれたプログラム](https://github.com/gabrieleilertsen/hdrcnn)をTensorFlow2.*で動作できるように変えています。
2
2
 
3
3
  その段階で躓いてしまったので、教えていただきたいです。
4
4