Giter VIP home page Giter VIP logo

tf-adain's People

Contributors

alessiamarcolini avatar ftokarev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tf-adain's Issues

Training on own dataset.

Hi,

Could you please provide an example on how to use a trained model on our own dataset?

I am taking the following steps:

  1. After the checkpoint is created, I pass the checkpoint to test.py as "decoder_weights".
  2. I had to change "saver.restore(sess, decoder_weights)" to "saver.restore(sess, tf.train.latest_checkpoint(decoder_weights))" to read it successfully from checkpoint directory.
  3. What should be passed to vgg_weights in test.py? Are we not fine-tuning the encoder (i.e. vgg weights) in the training on our own dataset?
    Does it remain same as "models/vgg19_weights_normalized.h5"?

Thank you in advance.

Training

Could you provide the last checkpoint please to resume it in training process ?

Error image shape

19/5000
I have encountered this error when I run test.py with cpu:
ValueError: Cannot feed value of shape (2, 3, 380, 600) for Tensor 'Placeholder:0', which has shape '(?, ?, ?, 3)'

wrong prepare_image call in CPU mode

Hi,

In test.py in CPU mode the call to prepare_image line (178 and 179) returns wrong image shape due to wrong data_format.
To fix just pass the data_format para:

style_image = prepare_image(style_image, True, data_format)
content_image = prepare_image(content_image, True, data_format)

tensorflow.python.framework.errors_impl.InvalidArgumentError: Default MaxPoolingOp only supports NHWC on device type CPU [[{{node vgg/pool1/MaxPool}}]]

Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1356, in _do_call
return fn(*args)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1341, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Default MaxPoolingOp only supports NHWC on device type CPU
[[{{node vgg/pool1/MaxPool}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "test.py", line 274, in
style_transfer(**vars(args))
File "test.py", line 181, in style_transfer
image: style_image[np.newaxis,:]
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 950, in run
run_metadata_ptr)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1173, in _run
feed_dict_tensor, options, run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1350, in _do_run
run_metadata)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1370, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Default MaxPoolingOp only supports NHWC on device type CPU
[[node vgg/pool1/MaxPool (defined at /tmp/tmpsb0fdgud.py:30) ]]

Errors may have originated from an input operation.
Input Source operations connected to node vgg/pool1/MaxPool:
vgg/conv1_2/Relu (defined at /tmp/tmp649k6325.py:74)

Original stack trace for 'vgg/pool1/MaxPool':
File "test.py", line 274, in
style_transfer(**vars(args))
File "test.py", line 83, in style_transfer
decoder_weights if decoder_in_h5 else None, alpha, data_format=data_format)
File "test.py", line 216, in build_graph
vgg = build_vgg(image, w, data_format=data_format)
File "/home/nd/workspace/workspace_lsh/tf-adain/adain/nn.py", line 54, in build_vgg
activation=tf.nn.relu, trainable=False, data_format=data_format)
File "/home/nd/workspace/workspace_lsh/tf-adain/adain/nn.py", line 102, in build_net
data_format=data_format)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py", line 324, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/layers/pooling.py", line 311, in max_pooling2d
return layer.apply(inputs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/keras/engine/base_layer.py", line 1479, in apply
return self.call(inputs, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/layers/base.py", line 537, in call
outputs = super(Layer, self).call(inputs, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/keras/engine/base_layer.py", line 634, in call
outputs = call_fn(inputs, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/autograph/impl/api.py", line 146, in wrapper
), args, kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/autograph/impl/api.py", line 450, in converted_call
result = converted_f(*effective_args, **kwargs)
File "/tmp/tmpsb0fdgud.py", line 30, in tf__call
outputs = ag
.converted_call('pool_function', self, ag__.ConversionOptions(recursive=True, force_conversion=False, optional_features=(), internal_convert_user_code=True), (inputs,), {'ksize': pool_shape, 'strides': strides, 'padding': ag__.converted_call('upper', self.padding, ag__.ConversionOptions(recursive=True, force_conversion=False, optional_features=(), internal_convert_user_code=True), (), None), 'data_format': ag__.converted_call('convert_data_format', conv_utils, ag__.ConversionOptions(recursive=True, force_conversion=False, optional_features=(), internal_convert_user_code=True), (self.data_format, 4), None)})
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/autograph/impl/api.py", line 356, in converted_call
return _call_unconverted(f, args, kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/autograph/impl/api.py", line 253, in _call_unconverted
return f(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/nn_ops.py", line 3756, in max_pool
name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/ops/gen_nn_ops.py", line 5672, in max_pool
data_format=data_format, name=name)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 3616, in create_op
op_def=op_def)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 2005, in init
self._traceback = tf_stack.extract_stack()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.