Advertisement
Guest User

Untitled

a guest
May 28th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. model = Sequential()
  2. model.add(InputLayer((1, H, W)))
  3.  
  4. model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
  5. model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
  6. last = Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu')
  7. model.add(last)
  8.  
  9. a_model = Sequential()
  10. a_model.add(last)
  11. a_model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
  12. a_model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
  13. a_model.add(Convolution2D(1, 3, 3, border_mode = 'same', activation = 'sigmoid'))
  14.  
  15. b_model = Sequential()
  16. b_model.add(last)
  17. b_model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
  18. b_model.add(Convolution2D(64, 5, 5, border_mode = 'same', activation = 'relu'))
  19. b_model.add(Convolution2D(1, 3, 3, border_mode = 'same', activation = 'sigmoid'))
  20.  
  21. model.add(Merge((a_model, b_model), mode = 'concat'))
  22.  
  23. Using Theano backend.
  24. Using gpu device 0: GeForce GTX TITAN (CNMeM is disabled, cuDNN 5004)
  25. Traceback (most recent call last):
  26. File "/home/chase/workspace/Colorizer/colorizer2.py", line 79, in <module>
  27. model.add(Merge((a_model, b_model), mode = 'concat'))
  28. File "/usr/local/lib/python3.5/dist-packages/keras/engine/topology.py", line 1118, in __init__
  29. self.add_inbound_node(layers, node_indices, tensor_indices)
  30. File "/usr/local/lib/python3.5/dist-packages/keras/engine/topology.py", line 524, in add_inbound_node
  31. assert len(node_indices) == len(inbound_layers)
  32. AssertionError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement