Giter VIP home page Giter VIP logo

deep-learning-tutorials's People

Contributors

dalmia avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

deep-learning-tutorials's Issues

ValueError: The initial value's shape (()) is not compatible with the explicitly supplied `shape` argument ([11, 11, 3, 96]).

There are many errors that occurs in TensorFlow 1.5 and TensorFlow 2.1. Even though I corrected some of the errors, it has generated a new error as follows.

ValueError: The initial value's shape (()) is not compatible with the explicitly supplied shape argument ([11, 11, 3, 96]).

I get to know that there is the scope conflict between the shape and the conv argument. tf.variable_scope() usually defines global variables in the with context. It influences other related variables. For instance, shape= [filter_height, filter_width, input_channels//groups, num_filters], it denotes [11,11,3,96] in the Conv1; in contrast, Conv1 includes the arguments: 11, 11, 96, 4, 4.

Please see the detailed error message as follows.

$ python finetune.py --conv=4 --dropout_rate=0.3
Traceback (most recent call last):
File "finetune.py", line 291, in
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/home/mike/miniconda3/lib/python3.7/site-packages/tensorflow_core/python/platform/app.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "/home/mike/miniconda3/lib/python3.7/site-packages/absl/app.py", line 299, in run
_run_main(main, args)
File "/home/mike/miniconda3/lib/python3.7/site-packages/absl/app.py", line 250, in _run_main
sys.exit(main(argv))
File "finetune.py", line 201, in main
FLAGS.dropout_rate, FLAGS.additional)
File "finetune.py", line 43, in train
model = AlexNet(x, keep_prob, num_classes, train_layers, fc, conv, additional)
File "/home/mike/Documents/Finetuning-AlexNet/model.py", line 33, in init
self.create()
File "/home/mike/Documents/Finetuning-AlexNet/model.py", line 89, in create
conv1 = conv(self.x, 11, 11, 96, 4, 4, padding='VALID', name='conv1')
File "/home/mike/Documents/Finetuning-AlexNet/model.py", line 154, in conv
num_filters])
File "/home/mike/miniconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 260, in call
return cls._variable_v2_call(*args, **kwargs)
File "/home/mike/miniconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 254, in _variable_v2_call
shape=shape)
File "/home/mike/miniconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 235, in
previous_getter = lambda **kws: default_variable_creator_v2(None, **kws)
File "/home/mike/miniconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/variable_scope.py", line 2645, in default_variable_creator_v2
shape=shape)
File "/home/mike/miniconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 262, in call
return super(VariableMetaclass, cls).call(*args, **kwargs)
File "/home/mike/miniconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py", line 1411, in init
distribute_strategy=distribute_strategy)
File "/home/mike/miniconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py", line 1549, in _init_from_args
(initial_value.shape, shape))
ValueError: The initial value's shape (()) is not compatible with the explicitly supplied shape argument ([11, 11, 3, 96]).

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.