Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. #changed from 9 to 33 for 11 frames input
  2. imgs_input = Input(shape=(33,input_height,input_width))
  3.  
  4. Traceback (most recent call last):
  5. File "predict_video.py", line 55, in <module>
  6. m.load_weights( save_weights_path )
  7. File "/usr/local/lib/python2.7/dist-packages/keras/engine/network.py", line 1166, in load_weights
  8. f, self.layers, reshape=reshape)
  9. File "/usr/local/lib/python2.7/dist-packages/keras/engine/saving.py", line 1058, in load_weights_from_hdf5_group
  10. K.batch_set_value(weight_value_tuples)
  11. File "/usr/local/lib/python2.7/dist-packages/keras/backend/tensorflow_backend.py", line 2465, in batch_set_value
  12. assign_op = x.assign(assign_placeholder)
  13. File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/variables.py", line 1952, in assign
  14. name=name)
  15. File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/state_ops.py", line 227, in assign
  16. validate_shape=validate_shape)
  17. File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_state_ops.py", line 66, in assign
  18. use_locking=use_locking, name=name)
  19. File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
  20. op_def=op_def)
  21. File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
  22. return func(*args, **kwargs)
  23. File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 3616, in create_op
  24. op_def=op_def)
  25. File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 2027, in __init__
  26. control_input_ops)
  27. File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 1867, in _create_c_op
  28. raise ValueError(str(e))
  29. ValueError: Dimension 0 in both shapes must be equal, but are 3 and 64. Shapes are [3,3,33,64] and [64,9,3,3]. for 'Assign' (op: 'Assign') with input shapes: [3,3,33,64], [64,9,3,3].
  30.  
  31. imgs_input = Input(shape=(9,input_height,input_width))
  32.  
  33. m = modelFN( n_classes , input_height=height, input_width=width )
  34.  
  35. #load TrackNet model
  36. modelFN = Models.TrackNet.TrackNet
  37. m = modelFN( n_classes , input_height=height, input_width=width )
  38. m.compile(loss='categorical_crossentropy', optimizer= 'adadelta' , metrics=['accuracy'])
  39. #load and save from same path
  40. m.load_weights( save_weights_path )
  41.  
  42. #load TrackNet 11 frames model and transfer weights
  43. model11 = Models.TrackNet11.TrackNet11
  44. m11 = model11(n_classes, input_height=height, input_width=width)
  45. m11.compile(loss='categorical_crossentropy', optimizer='adadelta', metrics=['accuracy'])
  46. m11.load_weights(m.get_weights)
  47.  
  48. ValueError: The channel dimension of the inputs should be defined. Found `None`.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement