hlpr98

Traceback

Apr 27th, 2020
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.99 KB | None | 0 0
  1. Epoch 1/10
  2. ---------------------------------------------------------------------------
  3. ValueError                                Traceback (most recent call last)
  4. <ipython-input-150-36a621ecaf7d> in <module>()
  5.       1 try:
  6.       2   with tensorflow.device('/device:GPU:0'):
  7. ----> 3     run_program()
  8.       4 except RuntimeError as e:
  9.       5   print(e)
  10.  
  11. 13 frames
  12. <ipython-input-149-d5d8decfd91a> in run_program()
  13.      15         validation_data=validation_generator,
  14.      16         validation_steps=STEPS_PER_EPOCH_VALIDATION,
  15. ---> 17         callbacks=[cb_checkpointer, cb_early_stopper]
  16.      18   )
  17.      19
  18.  
  19. /usr/local/lib/python3.6/dist-packages/tensorflow/python/util/deprecation.py in new_func(*args, **kwargs)
  20.     322               'in a future version' if date is None else ('after %s' % date),
  21.     323               instructions)
  22. --> 324       return func(*args, **kwargs)
  23.     325     return tf_decorator.make_decorator(
  24.     326         func, new_func, 'deprecated',
  25.  
  26. /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, validation_freq, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch)
  27.    1480         use_multiprocessing=use_multiprocessing,
  28.    1481         shuffle=shuffle,
  29. -> 1482         initial_epoch=initial_epoch)
  30.    1483
  31.    1484   @deprecation.deprecated(
  32.  
  33. /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py in _method_wrapper(self, *args, **kwargs)
  34.      64   def _method_wrapper(self, *args, **kwargs):
  35.      65     if not self._in_multi_worker_mode():  # pylint: disable=protected-access
  36. ---> 66       return method(self, *args, **kwargs)
  37.      67
  38.      68     # Running inside `run_distribute_coordinator` already.
  39.  
  40. /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, validation_batch_size, validation_freq, max_queue_size, workers, use_multiprocessing, **kwargs)
  41.     849                 batch_size=batch_size):
  42.     850               callbacks.on_train_batch_begin(step)
  43. --> 851               tmp_logs = train_function(iterator)
  44.     852               # Catch OutOfRangeError for Datasets of unknown size.
  45.     853               # This blocks until the batch has finished executing.
  46.  
  47. /usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/def_function.py in __call__(self, *args, **kwds)
  48.     578         xla_context.Exit()
  49.     579     else:
  50. --> 580       result = self._call(*args, **kwds)
  51.     581
  52.     582     if tracing_count == self._get_tracing_count():
  53.  
  54. /usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/def_function.py in _call(self, *args, **kwds)
  55.     625       # This is the first call of __call__, so we have to initialize.
  56.     626       initializers = []
  57. --> 627       self._initialize(args, kwds, add_initializers_to=initializers)
  58.     628     finally:
  59.     629       # At this point we know that the initialization is complete (or less
  60.  
  61. /usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/def_function.py in _initialize(self, args, kwds, add_initializers_to)
  62.     504     self._concrete_stateful_fn = (
  63.     505         self._stateful_fn._get_concrete_function_internal_garbage_collected(  # pylint: disable=protected-access
  64. --> 506             *args, **kwds))
  65.     507
  66.     508     def invalid_creator_scope(*unused_args, **unused_kwds):
  67.  
  68. /usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/function.py in _get_concrete_function_internal_garbage_collected(self, *args, **kwargs)
  69.    2444       args, kwargs = None, None
  70.    2445     with self._lock:
  71. -> 2446       graph_function, _, _ = self._maybe_define_function(args, kwargs)
  72.    2447     return graph_function
  73.    2448
  74.  
  75. /usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/function.py in _maybe_define_function(self, args, kwargs)
  76.    2775
  77.    2776       self._function_cache.missed.add(call_context_key)
  78. -> 2777       graph_function = self._create_graph_function(args, kwargs)
  79.    2778       self._function_cache.primary[cache_key] = graph_function
  80.    2779       return graph_function, args, kwargs
  81.  
  82. /usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/function.py in _create_graph_function(self, args, kwargs, override_flat_arg_shapes)
  83.    2665             arg_names=arg_names,
  84.    2666             override_flat_arg_shapes=override_flat_arg_shapes,
  85. -> 2667             capture_by_value=self._capture_by_value),
  86.    2668         self._function_attributes,
  87.    2669         # Tell the ConcreteFunction to clean up its graph once it goes out of
  88.  
  89. /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/func_graph.py in func_graph_from_py_func(name, python_func, args, kwargs, signature, func_graph, autograph, autograph_options, add_control_dependencies, arg_names, op_return_value, collections, capture_by_value, override_flat_arg_shapes)
  90.     979         _, original_func = tf_decorator.unwrap(python_func)
  91.     980
  92. --> 981       func_outputs = python_func(*func_args, **func_kwargs)
  93.     982
  94.     983       # invariant: `func_outputs` contains only Tensors, CompositeTensors,
  95.  
  96. /usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/def_function.py in wrapped_fn(*args, **kwds)
  97.     439         # __wrapped__ allows AutoGraph to swap in a converted function. We give
  98.     440         # the function a weak reference to itself to avoid a reference cycle.
  99. --> 441         return weak_wrapped_fn().__wrapped__(*args, **kwds)
  100.     442     weak_wrapped_fn = weakref.ref(wrapped_fn)
  101.     443
  102.  
  103. /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/func_graph.py in wrapper(*args, **kwargs)
  104.     966           except Exception as e:  # pylint:disable=broad-except
  105.     967             if hasattr(e, "ag_error_metadata"):
  106. --> 968               raise e.ag_error_metadata.to_exception(e)
  107.     969             else:
  108.     970               raise
  109.  
  110. ValueError: in user code:
  111.  
  112.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py:571 train_function  *
  113.         outputs = self.distribute_strategy.run(
  114.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/distribute/distribute_lib.py:951 run  **
  115.         return self._extended.call_for_each_replica(fn, args=args, kwargs=kwargs)
  116.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/distribute/distribute_lib.py:2290 call_for_each_replica
  117.         return self._call_for_each_replica(fn, args, kwargs)
  118.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/distribute/distribute_lib.py:2649 _call_for_each_replica
  119.         return fn(*args, **kwargs)
  120.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py:533 train_step  **
  121.         y, y_pred, sample_weight, regularization_losses=self.losses)
  122.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/compile_utils.py:204 __call__
  123.         loss_value = loss_obj(y_t, y_p, sample_weight=sw)
  124.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/losses.py:143 __call__
  125.         losses = self.call(y_true, y_pred)
  126.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/losses.py:246 call
  127.         return self.fn(y_true, y_pred, **self._fn_kwargs)
  128.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/losses.py:1527 categorical_crossentropy
  129.         return K.categorical_crossentropy(y_true, y_pred, from_logits=from_logits)
  130.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/backend.py:4561 categorical_crossentropy
  131.         target.shape.assert_is_compatible_with(output.shape)
  132.     /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/tensor_shape.py:1117 assert_is_compatible_with
  133.         raise ValueError("Shapes %s and %s are incompatible" % (self, other))
  134.  
  135.     ValueError: Shapes (None, 1) and (None, 2) are incompatible
Add Comment
Please, Sign In to add comment