Giter Site home page Giter Site logo

tensorflow-finetune-flickr-style's People

Contributors

joelthchao 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  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  avatar  avatar  avatar

tensorflow-finetune-flickr-style's Issues

can't get dateset

can you share you dateset in baidu cloud, it seem hard to get the dataset because of network time out!

question for test.txt file

hi,Thanks for your share first. I want to know what is the test.txt file look like? In this test.txt file, if a label is need for every image?

Problem for finetune VGG16 model

Hi, I try to modify your finetune.py and model.py in order to fine-tune VGG16 where converted from Caffe. I extracted VGG16_Tensorflow.npy via converting VGG16 Caffe model. The code shows error when I added "load_with_skip('VGG16_Tensorflow.npy', sess, ['fc8']) ", the error information is

Traceback (most recent call last):
  File "mff_vgg16.py", line 125, in <module>
    main()
  File "mff_vgg16.py", line 66, in main
    load_with_skip('VGG16_Tensorflow.npy', sess, ['fc8']) # Skip weights from fc8
  File "/home/larson/atensorflow_code/Document14C/finetune_example/network.py", line 19, in load_with_skip
    session.run(tf.get_variable(subkey).assign(data))
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variables.py", line 497, in assign
    return state_ops.assign(self._variable, value, use_locking=use_locking)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_state_ops.py", line 45, in assign
    use_locking=use_locking, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/op_def_library.py", line 455, in apply_op
    as_ref=input_arg.is_ref)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 620, in convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/constant_op.py", line 179, in _constant_tensor_conversion_function
    return constant(v, dtype=dtype, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/constant_op.py", line 162, in constant
    tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape))
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 353, in make_tensor_proto
    _AssertCompatible(values, dtype)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 290, in _AssertCompatible
    (dtype.name, repr(mismatch), type(mismatch).__name__))
TypeError: Expected float32, got 'weights' of type 'str' instead.

VGG16 model is

@staticmethod
    def VGG16(_X, _dropout, n_class):
        # part 1 (conv-conv-pool)
        conv1_1 = conv(_X, 3, 3, 64, 1, 1, padding='SAME', name='conv1_1')
        conv1_2 = conv(conv1_1, 3, 3, 64, 1, 1, padding='SAME', name='conv1_2')
        pool1 = max_pool(conv1_2, 2, 2, 2, 2, padding='SAME', name='pool1')
        # part 2 (conv-conv-pool)
        conv2_1 = conv(pool1, 3, 3, 128, 1, 1, padding='SAME', name='conv2_1')
        conv2_2 = conv(conv2_1, 3, 3, 128, 1, 1, padding='SAME', name='conv2_2')
        pool2 = max_pool(conv2_2, 2, 2, 2, 2, padding='SAME', name='pool2')
        # part 3 (conv-conv-conv-pool)
        conv3_1 = conv(pool2, 3, 3, 256, 1, 1, padding='SAME', name='conv3_1')
        conv3_2 = conv(conv3_1, 3, 3, 256, 1, 1, padding='SAME', name='conv3_2')
        conv3_3 = conv(conv3_2, 3, 3, 256, 1, 1, padding='SAME', name='conv3_3')
        pool3 = max_pool(conv3_3, 2, 2, 2, 2, padding='SAME', name='pool3')
        # part 4 (conv-conv-conv-pool)
        conv4_1 = conv(pool3, 3, 3, 512, 1, 1, padding='SAME', name='conv4_1')
        conv4_2 = conv(conv4_1, 3, 3, 512, 1, 1, padding='SAME', name='conv4_2')
        conv4_3 = conv(conv4_2, 3, 3, 512, 1, 1, padding='SAME', name='conv4_3')
        pool4 = max_pool(conv4_3, 2, 2, 2, 2, padding='SAME', name='pool4')
        # part 5 (conv-conv-conv-pool)
        conv5_1 = conv(pool4, 3, 3, 512, 1, 1, padding='SAME', name='conv5_1')
        conv5_2 = conv(conv5_1, 3, 3, 512, 1, 1, padding='SAME', name='conv5_2')
        conv5_3 = conv(conv5_2, 3, 3, 512, 1, 1, padding='SAME', name='conv5_3')
        pool5 = max_pool(conv5_3, 2, 2, 2, 2, padding='SAME', name='pool5')
        # Layer 6 (fc-relu-drop)
        fc6 = tf.reshape(pool5, [-1, 7*7*512])
        fc6 = fc(fc6, 7*7*512, 4096, name='fc6')
        fc6 = dropout(fc6, _dropout)
        # Layer 7 (fc-relu-drop)
        fc7 = fc(fc6, 4096, 4096, name='fc7')
        fc7 = dropout(fc7, _dropout)
        # Layer 8 (fc-prob)
        fc8 = fc(fc7, 4096, n_class, relu=False, name='fc8')
        return fc8

How to modify the code ?
Thanks a lot !

maybe overfitting?

  • thanks for you code. now i am run the code .
  • but i fond maybe the model overfitting.
2019-05-21 16:26:02.627367 Iter 5040: Training Loss = 0.0148, Accuracy = 1.0000
2019-05-21 16:26:07.453140 Iter 5060: Training Loss = 0.0249, Accuracy = 1.0000
2019-05-21 16:26:12.326071 Iter 5080: Training Loss = 0.0172, Accuracy = 1.0000
2019-05-21 16:26:17.227455 Iter 5100: Training Loss = 0.0552, Accuracy = 0.9800
2019-05-21 16:26:27.450521 Iter 5120: Testing Accuracy = 0.4336
  • there we can see , train loss is lower and train accuracy is near 1.0 ;while the test accuracy is 0.4336 .
  • later i will make some change to make test accuracy more high. I don't know if my understanding is right 。

How do you know the style mapping?

Hi, thanks for your remarkable work! I want to download photos with more than 20 styles in your code. I search a lot on flickr website, but cannot find any document about the style mapping. Can you give me a link which talk about this? Thanks!

How to download caffenet.npy?

Hello,when I use this project and I have read the readme ,But I still don't konw how to download the caffenet.npy.please I tell me how to download that,or you can give me a Internet connection。Thank you very much!

SyntaxError: invalid syntax

When I wanna download the flickr dataset,an error occurs:
python assemble_data.py images train.txt test.txt 500
File "assemble_data.py", line 67
print('{} {}'.format(url, class_id), file=f)
^
SyntaxError: invalid syntax
Do you know what the reason is?

Is the code for finetuning?

Dear author, thanks for your code, I am working on it. but I find that maybe it is not for finetuning as the model is not pretrained.
image
image
how to load a pretrained model? would you like to paste the code?
another question, what're the .txt files look like? I want to make them with my own dataset as the some urls in .csv are invalid.
thanks again, any help appreiated!

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.