You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running the FullNetGenerator to test the model loading, comes with such problem
Using gpu device 1: Tesla K80 (CNMeM is disabled, cuDNN 4007)
Traceback (most recent call last):
File "FullNetGenerator.py", line 40, in
fn = fng.create_full_net()
File "FullNetGenerator.py", line 12, in create_full_net
net = vgg_provider.get_vgg_partial_graph(weights_path=self.weights_path, with_output=False)
File "/home/zaikun/dl/statefarm/NNProject_DeepMask/VggDNetGraphProvider.py", line 60, in get_vgg_partial_graph
model = self.get_vgg_full_graph(weights_path, False)
File "/home/zaikun/dl/statefarm/NNProject_DeepMask/VggDNetGraphProvider.py", line 56, in get_vgg_full_graph
model.load_weights(weights_path)
File "/users/zaikun/anaconda2/lib/python2.7/site-packages/keras/legacy/models.py", line 775, in load_weights
super(Graph, self).load_weights(fname)
File "/users/zaikun/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 2309, in load_weights
str(len(flattened_layers)) + '.')
Exception: You are trying to load a weight file containing 37 layers into a model with 0.
The text was updated successfully, but these errors were encountered:
You are correct- there is an issue here.
If you downloaded the weights from the link in the readme file, they suit a sequential model, whereas my model is a graph (to allow a split net). You should run HelperScripts/CreateVggGraphWeights.py first to create a weights file suited for a graph.
I will add this to the readme- thank you!
this HelperScripts/CreateVggGraphWeights.py runs with error
File "HelperScripts/CreateVggGraphWeights.py", line 150, in
graph.set_weights(model.get_weights())
File "/users/zaikun/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 841, in set_weights
params = self.trainable_weights + self.non_trainable_weights
File "/users/zaikun/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 1840, in trainable_weights
for layer in self.layers:
AttributeError: 'Graph' object has no attribute 'layers'
I am running the FullNetGenerator to test the model loading, comes with such problem
Using gpu device 1: Tesla K80 (CNMeM is disabled, cuDNN 4007)
Traceback (most recent call last):
File "FullNetGenerator.py", line 40, in
fn = fng.create_full_net()
File "FullNetGenerator.py", line 12, in create_full_net
net = vgg_provider.get_vgg_partial_graph(weights_path=self.weights_path, with_output=False)
File "/home/zaikun/dl/statefarm/NNProject_DeepMask/VggDNetGraphProvider.py", line 60, in get_vgg_partial_graph
model = self.get_vgg_full_graph(weights_path, False)
File "/home/zaikun/dl/statefarm/NNProject_DeepMask/VggDNetGraphProvider.py", line 56, in get_vgg_full_graph
model.load_weights(weights_path)
File "/users/zaikun/anaconda2/lib/python2.7/site-packages/keras/legacy/models.py", line 775, in load_weights
super(Graph, self).load_weights(fname)
File "/users/zaikun/anaconda2/lib/python2.7/site-packages/keras/engine/topology.py", line 2309, in load_weights
str(len(flattened_layers)) + '.')
Exception: You are trying to load a weight file containing 37 layers into a model with 0.
The text was updated successfully, but these errors were encountered: