Comments (7)
I think 2 GB is enough. I tried to limit memory usage by using tf.ConfigProto and it run (batch size = 8, memory consumption = 1833 MB).
Are you using cuDNN v5.1?
from srgan.
Yes, CUDA 8.0 with cuDNN 5.1. The available memory on my computer is about 1 3GB.
I notice that you use all the features in the VGG, which is different from the orginal paper. Could it be the reason why the model need that much memory?
from srgan.
The available memory on my computer is about 1 3GB.
1.3 GB?
Could it be the reason why the model need that much memory?
I think SRGAN needs much memory as it builds Generator (ResNet), Discrimitator, and VGG19.
As you said, it might have an effect on reducing memory usage.
Modify inference_content_loss as follows:
def inference_content_loss(x, imitation):
_, x_phi = self.vgg.build_model(
x, tf.constant(False), False)
_, imitation_phi = self.vgg.build_model(
imitation, tf.constant(False), True)
content_loss = tf.nn.l2_loss(x_phi[4] - imitation_phi[4]) # phi54
return tf.reduce_mean(content_loss)
from srgan.
I've installed the environment needed on another computer with enough memory.
However I get another error when the first epoch finished.
Caused by op 'generator/deconv1/conv2d_transpose', defined at:
File "train.py", line 95, in
train()
File "train.py", line 18, in train
model = SRGAN(x, is_training, batch_size)
File "/home/min/ssq/srgan/src/srgan.py", line 14, in init
self.imitation = self.generator(self.downscaled, is_training, False)
File "/home/min/ssq/srgan/src/srgan.py", line 25, in generator
x, [3, 3, 64, 3], [self.batch_size, 24, 24, 64], 1)
File "../utils/layer.py", line 43, in deconv_layer
strides=[1, stride, stride, 1])
File "/home/min/anaconda/envs/shen/lib/python3.6/site-packages/tensorflow/python/ops/nn_ops.py", line 1104, in conv2d_transpose
name=name)
File "/home/min/anaconda/envs/shen/lib/python3.6/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 496, in conv2d_backprop_input
data_format=data_format, name=name)
File "/home/min/anaconda/envs/shen/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 768, in apply_op
op_def=op_def)
File "/home/min/anaconda/envs/shen/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2336, in create_op
original_op=self._default_original_op, op_def=op_def)
File "/home/min/anaconda/envs/shen/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1228, in init
self._traceback = _extract_stack()InvalidArgumentError (see above for traceback): Conv2DSlowBackpropInput: input and out_backprop must have the same batch size
from srgan.
Fix on line 45 of src/train.py
True:
n_iter = int(len(x_train) / batch_size)
False:
n_iter = int(np.ceil(len(x_train) / batch_size))
from srgan.
The implementation of your generator seems different from the paper where only last two layers are deconvolution layers(they changed into sub-pixel CNN recently). You used deconv_layer in all of the residual blocks. Is that a mistake or you intended to?
from srgan.
Hi, Tadax, yes I have the same concern as @Doodleyard . Although in the CVPR paper the final published generator network is different from their arXiv version, from your code is neither of them. Do you mind to give us some hints? thank you.
from srgan.
Related Issues (15)
- TypeError: load() got an unexpected keyword argument 'encoding' HOT 3
- TypeError: integer argument expected, got float HOT 1
- Generator picture error!
- how much epoch should train?
- I cannot find how sub images are implemented?
- How to get Imagenet?
- When i run "train.py", there is an error- epoch = int(sess.run(global_step) / np.ceil(len(x_train)/batch_size)) + 1 TypeError: object of type 'NoneType' has no len()
- NPZ File Required while running the transfer model demo
- Typo in README.md HOT 1
- TypeError: lrelu() takes 1 positional argument but 2 were given HOT 2
- How to get the VGG54 as the content loss as the paper said HOT 22
- when running the 'train.py' in src, there are some errors. HOT 5
- Some Absurd Colour Artifacts HOT 4
- The Generator Network implementation is different from original
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from srgan.