Skip to content

Commit 2b151ad

Browse files
committed
Fixed problem with GPU
1 parent beebc43 commit 2b151ad

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

vgg16.py

+14-10
Original file line numberDiff line numberDiff line change
@@ -170,16 +170,20 @@ def create_feed_dict(self, image):
170170
# VGG16 model was built to take multiple images as input.
171171
image = np.expand_dims(image, axis=0)
172172

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}
183187

184188
return feed_dict
185189

0 commit comments

Comments
 (0)