@@ -170,16 +170,20 @@ def create_feed_dict(self, image):
170
170
# VGG16 model was built to take multiple images as input.
171
171
image = np .expand_dims (image , axis = 0 )
172
172
173
- # In the original code using this VGG16 model, the random values
174
- # for the dropout are fixed to 1.0.
175
- # Experiments suggest that it does not seem to matter for
176
- # Style Transfer, but we do it anyway.
177
- dropout_fix = 1.0
178
-
179
- # Create feed-dict for inputting data to TensorFlow.
180
- feed_dict = {self .tensor_name_input_image : image ,
181
- self .tensor_name_dropout : [[dropout_fix ]],
182
- self .tensor_name_dropout1 : [[dropout_fix ]]}
173
+ if False :
174
+ # In the original code using this VGG16 model, the random values
175
+ # for the dropout are fixed to 1.0.
176
+ # Experiments suggest that it does not seem to matter for
177
+ # Style Transfer, and this causes an error with a GPU.
178
+ dropout_fix = 1.0
179
+
180
+ # Create feed-dict for inputting data to TensorFlow.
181
+ feed_dict = {self .tensor_name_input_image : image ,
182
+ self .tensor_name_dropout : [[dropout_fix ]],
183
+ self .tensor_name_dropout1 : [[dropout_fix ]]}
184
+ else :
185
+ # Create feed-dict for inputting data to TensorFlow.
186
+ feed_dict = {self .tensor_name_input_image : image }
183
187
184
188
return feed_dict
185
189
0 commit comments