Comments (1)
Thank you for this pointer , however I still am getting an error which is
ValueError: The name "dense_regress_178" is used 2 times in the model. All layer names should be unique.
I have named the layers in detect.py as follows
resnetlast = (model_classifier.layers[-1].output)
out_class = TimeDistributed(Dense(int(resnetlast.shape[2]), kernel_initializer='uniform'),name='time_distributed_2')(resnetlast)
out_class = Activation('relu')(out_class)
out_class = Dropout(.5)(out_class)
out_class = TimeDistributed(Dense(word.shape[0], activation='linear', kernel_initializer='uniform'),name='time_distributed_3')(out_class)
out_class = TimeDistributed(Dense(word.shape[0], activation='linear', kernel_initializer='uniform'),name='dense_class_{}'.format(nb_classes))(out_class)
out_class = MyLayer(output_dim=word_all.shape[1])(out_class)
and this seems to be causing the problem
out_regr = TimeDistributed(Dense(4 * (nb_classes - 1), activation='linear', kernel_initializer='zero'),name='dense_regress_{}'.format(nb_classes))(resnetlast)
Since this was a problem with the naming which is arbitrary I thought perhaps changing this to any other name like in the line below would solve this issue
out_regr = TimeDistributed(Dense(4 * (nb_classes - 1), activation='linear', kernel_initializer='zero'),name='dense_regressor_{}'.format(nb_classes))(resnetlast)
it does get rid of the previous ValueError
but causes an error when the model loads weights
model_classifier.load_weights(C.model_path, by_name=True)
ValueError: Layer #178 (named "time_distributed_2"), weight <tf.Variable 'time_distributed_2/kernel:0' shape=(708, 708) dtype=float32, numpy=
array([[ 0.03911747, -0.02416103, -0.04996177, ..., -0.00052779,
-0.04415029, 0.03913448],
[ 0.02350913, -0.04238098, 0.04727681, ..., 0.00107334,
0.03948401, 0.0225733 ],
[ 0.00324714, 0.0267023 , 0.03767557, ..., -0.03660261,
0.02911811, -0.04166988],
...,
[ 0.00710471, -0.02927768, 0.02644283, ..., 0.0140437 ,
0.02945073, -0.01651412],
[ 0.03027074, -0.03358974, 0.03127309, ..., -0.00256994,
-0.00981454, -0.00117335],
[ 0.00760389, 0.02819859, -0.02207704, ..., -0.01791253,
-0.04420076, -0.00320693]], dtype=float32)> has shape (708, 708), but the saved weight has shape (2048, 2048).
Any help to solve this is greatly appreciated. Also, posted the latter as a separate issue in case this isn't related to the naming mismatching.
from zsd_release.
Related Issues (11)
- Training code HOT 1
- Shapes of the layers mismatch when using pretrained model
- This predict.py file can't perform well when the seen and unseen objects appear in one image HOT 3
- How to get Model/config.pickle file? HOT 1
- ValueError HOT 2
- Can you share the detail about W2? HOT 1
- Can you share the train code? HOT 2
- how to create our own config.pickle file for our custom dataset? HOT 1
- type error HOT 1
- python detect.py causng error HOT 2
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 zsd_release.