Error in C2W2_Assignment Exercise 6

Little help from the log here but I think the problem is this lines:

 # Create a feature that shows if the traffic volume is greater than the mean and cast to an int
    outputs[_transformed_name(_VOLUME_KEY)] = tf.cast(  
        
        # Use `tf.greater` to check if the traffic volume in a row is greater than the mean of the entire traffic volumn column
        tf.greater(traffic_volume, tft.mean(tf.cast(inputs[_VOLUME_KEY], tf.float32))),
        
        tf.int64)         
---------------------------------------------------------------------------
UnimplementedError                        Traceback (most recent call last)
/opt/conda/lib/python3.8/site-packages/tensorflow_transform/beam/impl.py in _handle_batch(self, batch)
    345       else:
--> 346         result = self._graph_state.callable_get_outputs(feed_dict)
    347         assert len(self._graph_state.outputs_tensor_keys) == len(result)

/opt/conda/lib/python3.8/site-packages/tensorflow_transform/saved/saved_transform_io_v2.py in apply_transform_model(self, logical_input_map)
    355     elif self._is_finalized:
--> 356       return self._apply_v2_transform_model_finalized(logical_input_map)
    357     else:

/opt/conda/lib/python3.8/site-packages/tensorflow_transform/saved/saved_transform_io_v2.py in _apply_v2_transform_model_finalized(self, logical_input_map)
    281     modified_inputs = self._format_input_map_as_tensors(logical_input_map)
--> 282     return self._wrapped_function_finalized(modified_inputs)
    283 

/opt/conda/lib/python3.8/site-packages/tensorflow/python/eager/function.py in __call__(self, *args, **kwargs)
   1706     """
-> 1707     return self._call_impl(args, kwargs)
   1708 

/opt/conda/lib/python3.8/site-packages/tensorflow/python/eager/function.py in _call_impl(self, args, kwargs, cancellation_manager)
   1715         try:
-> 1716           return self._call_with_structured_signature(args, kwargs,
   1717                                                       cancellation_manager)

/opt/conda/lib/python3.8/site-packages/tensorflow/python/eager/function.py in _call_with_structured_signature(self, args, kwargs, cancellation_manager)
   1796     self._structured_signature_check_arg_types(args, kwargs)
-> 1797     return self._call_flat(
   1798         filtered_flat_args,

/opt/conda/lib/python3.8/site-packages/tensorflow/python/eager/function.py in _call_flat(self, args, captured_inputs, cancellation_manager)
   1962       # No tape is watching; skip to running the function.
-> 1963       return self._build_call_outputs(self._inference_function.call(
   1964           ctx, args, cancellation_manager=cancellation_manager))

/opt/conda/lib/python3.8/site-packages/tensorflow/python/eager/function.py in call(self, ctx, args, cancellation_manager)
    590         if cancellation_manager is None:
--> 591           outputs = execute.execute(
    592               str(self.signature.name),

/opt/conda/lib/python3.8/site-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     58     ctx.ensure_initialized()
---> 59     tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
     60                                         inputs, attrs, num_outputs)

UnimplementedError:  Cast string to float is not supported
	 [[{{node StatefulPartitionedCall/scale_to_0_1_3/Cast}}]] [Op:__inference_wrapped_finalized_8009]

Function call stack:
wrapped_finalized


During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.PerWindowInvoker.invoke_process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common._OutputProcessor.process_outputs()

/opt/conda/lib/python3.8/site-packages/tensorflow_transform/beam/impl.py in process(self, batch, saved_model_dir)
    405 
--> 406     yield self._handle_batch(batch)
    407 

/opt/conda/lib/python3.8/site-packages/tensorflow_transform/beam/impl.py in _handle_batch(self, batch)
    348     except Exception as e:
--> 349       raise ValueError(
    350           """An error occured while trying to apply the transformation: "{}".

ValueError: An error occured while trying to apply the transformation: " Cast string to float is not supported
	 [[{{node StatefulPartitionedCall/scale_to_0_1_3/Cast}}]] [Op:__inference_wrapped_finalized_8009]

Function call stack:
wrapped_finalized
".
          Batch instances: pyarrow.RecordBatch
clouds_all: large_list<item: int64>
  child 0, item: int64
date_time: large_list<item: large_binary>
  child 0, item: large_binary
day: large_list<item: int64>
  child 0, item: int64
day_of_week: large_list<item: int64>
  child 0, item: int64
holiday: large_list<item: large_binary>
  child 0, item: large_binary
hour: large_list<item: int64>
  child 0, item: int64
month: large_list<item: int64>
  child 0, item: int64
rain_1h: large_list<item: float>
  child 0, item: float
snow_1h: large_list<item: float>
  child 0, item: float
temp: large_list<item: float>
  child 0, item: float
traffic_volume: large_list<item: int64>
  child 0, item: int64
weather_description: large_list<item: large_binary>
  child 0, item: large_binary
weather_main: large_list<item: large_binary>
  child 0, item: large_binary,
          Fetching the values for the following Tensor keys: {'compute_and_apply_vocabulary_2/vocabulary/Reshape', 'compute_and_apply_vocabulary_1/vocabulary/Reshape', 'scale_to_0_1_2/min_and_max/Identity_1', 'scale_to_0_1_1/min_and_max/Identity_1', 'scale_to_0_1_1/min_and_max/Identity', 'scale_to_0_1_2/min_and_max/Identity', 'mean/mean_and_var/div_no_nan', 'scale_to_0_1_4/min_and_max/Identity_1', 'inputs_7_copy', 'scale_to_0_1_5/min_and_max/Identity', 'scale_to_0_1_3/min_and_max/Identity_1', 'compute_and_apply_vocabulary/vocabulary/Reshape', 'scale_to_0_1/min_and_max/Identity_1', 'scale_to_0_1_4/min_and_max/Identity', 'compute_and_apply_vocabulary_3/vocabulary/Reshape', 'mean/mean_and_var/div_no_nan_1', 'mean/mean_and_var/zeros', 'scale_to_0_1/min_and_max/Identity', 'scale_to_0_1_5/min_and_max/Identity_1', 'scale_to_0_1_3/min_and_max/Identity', 'mean/mean_and_var/Cast_1'}.

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-28-e2a9c8e67836> in <module>
     14 with tft_beam.Context(temp_dir=tempfile.mkdtemp()):
     15     transformed_dataset, _ = (
---> 16         (raw_data, raw_data_metadata) | tft_beam.AnalyzeAndTransformDataset(traffic_transform.preprocessing_fn))
     17 
     18 transformed_data, transformed_metadata = transformed_dataset

/opt/conda/lib/python3.8/site-packages/apache_beam/transforms/ptransform.py in __ror__(self, left, label)
    618     _allocate_materialized_pipeline(p)
    619     materialized_result = _AddMaterializationTransforms().visit(result)
--> 620     p.run().wait_until_finish()
    621     _release_materialized_pipeline(p)
    622     return _FinalizeMaterialization().visit(materialized_result)

/opt/conda/lib/python3.8/site-packages/apache_beam/pipeline.py in run(self, test_runner_api)
    563         finally:
    564           shutil.rmtree(tmpdir)
--> 565       return self.runner.run_pipeline(self, self._options)
    566     finally:
    567       shutil.rmtree(self.local_tempdir, ignore_errors=True)

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/direct/direct_runner.py in run_pipeline(self, pipeline, options)
    129       runner = BundleBasedDirectRunner()
    130 
--> 131     return runner.run_pipeline(pipeline, options)
    132 
    133 

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py in run_pipeline(self, pipeline, options)
    193         options.view_as(pipeline_options.ProfilingOptions))
    194 
--> 195     self._latest_run_result = self.run_via_runner_api(
    196         pipeline.to_runner_api(default_environment=self._default_environment))
    197     return self._latest_run_result

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py in run_via_runner_api(self, pipeline_proto)
    204     # TODO(pabloem, BEAM-7514): Create a watermark manager (that has access to
    205     #   the teststream (if any), and all the stages).
--> 206     return self.run_stages(stage_context, stages)
    207 
    208   @contextlib.contextmanager

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py in run_stages(self, stage_context, stages)
    382           )
    383 
--> 384           stage_results = self._run_stage(
    385               runner_execution_context, bundle_context_manager)
    386 

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py in _run_stage(self, runner_execution_context, bundle_context_manager)
    644     while True:
    645       last_result, deferred_inputs, fired_timers, watermark_updates = (
--> 646           self._run_bundle(
    647               runner_execution_context,
    648               bundle_context_manager,

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py in _run_bundle(self, runner_execution_context, bundle_context_manager, data_input, data_output, input_timers, expected_timer_output, bundle_manager)
    767         expected_timer_output)
    768 
--> 769     result, splits = bundle_manager.process_bundle(
    770         data_input, data_output, input_timers, expected_timer_output)
    771     # Now we collect all the deferred inputs remaining from bundle execution.

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py in process_bundle(self, inputs, expected_outputs, fired_timers, expected_output_timers, dry_run)
   1078             process_bundle_descriptor.id,
   1079             cache_tokens=[next(self._cache_token_generator)]))
-> 1080     result_future = self._worker_handler.control_conn.push(process_bundle_req)
   1081 
   1082     split_results = []  # type: List[beam_fn_api_pb2.ProcessBundleSplitResponse]

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py in push(self, request)
    376       self._uid_counter += 1
    377       request.instruction_id = 'control_%s' % self._uid_counter
--> 378     response = self.worker.do_instruction(request)
    379     return ControlFuture(request.instruction_id, response)
    380 

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py in do_instruction(self, request)
    600     if request_type:
    601       # E.g. if register is set, this will call self.register(request.register))
--> 602       return getattr(self, request_type)(
    603           getattr(request, request_type), request.instruction_id)
    604     else:

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py in process_bundle(self, request, instruction_id)
    638         with self.maybe_profile(instruction_id):
    639           delayed_applications, requests_finalization = (
--> 640               bundle_processor.process_bundle(instruction_id))
    641           monitoring_infos = bundle_processor.monitoring_infos()
    642           monitoring_infos.extend(self.state_cache_metrics_fn())

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/bundle_processor.py in process_bundle(self, instruction_id)
    994                   element.timer_family_id, timer_data)
    995           elif isinstance(element, beam_fn_api_pb2.Elements.Data):
--> 996             input_op_by_transform_id[element.transform_id].process_encoded(
    997                 element.data)
    998 

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/bundle_processor.py in process_encoded(self, encoded_windowed_values)
    220       decoded_value = self.windowed_coder_impl.decode_from_stream(
    221           input_stream, True)
--> 222       self.output(decoded_value)
    223 
    224   def monitoring_infos(self, transform_id, tag_to_pcollection_id):

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.Operation.output()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.Operation.output()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.SingletonConsumerSet.receive()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner._reraise_augmented()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.SimpleInvoker.invoke_process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common._OutputProcessor.process_outputs()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.SingletonConsumerSet.receive()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner._reraise_augmented()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.SimpleInvoker.invoke_process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common._OutputProcessor.process_outputs()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.ConsumerSet.receive()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner._reraise_augmented()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.SimpleInvoker.invoke_process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common._OutputProcessor.process_outputs()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.SingletonConsumerSet.receive()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner._reraise_augmented()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.SimpleInvoker.invoke_process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common._OutputProcessor.process_outputs()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.SingletonConsumerSet.receive()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner._reraise_augmented()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.SimpleInvoker.invoke_process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common._OutputProcessor.process_outputs()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.SingletonConsumerSet.receive()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner._reraise_augmented()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.SimpleInvoker.invoke_process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common._OutputProcessor.process_outputs()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.SingletonConsumerSet.receive()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner._reraise_augmented()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.SimpleInvoker.invoke_process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common._OutputProcessor.process_outputs()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.SingletonConsumerSet.receive()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner._reraise_augmented()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.SimpleInvoker.invoke_process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common._OutputProcessor.process_outputs()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.SingletonConsumerSet.receive()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/worker/operations.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.worker.operations.DoOperation.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner._reraise_augmented()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.DoFnRunner.process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.PerWindowInvoker.invoke_process()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common.PerWindowInvoker._invoke_process_per_window()

/opt/conda/lib/python3.8/site-packages/apache_beam/runners/common.cpython-38-x86_64-linux-gnu.so in apache_beam.runners.common._OutputProcessor.process_outputs()

/opt/conda/lib/python3.8/site-packages/tensorflow_transform/beam/impl.py in process(self, batch, saved_model_dir)
    404     assert self._graph_state.saved_model_dir == saved_model_dir
    405 
--> 406     yield self._handle_batch(batch)
    407 
    408 

/opt/conda/lib/python3.8/site-packages/tensorflow_transform/beam/impl.py in _handle_batch(self, batch)
    347         assert len(self._graph_state.outputs_tensor_keys) == len(result)
    348     except Exception as e:
--> 349       raise ValueError(
    350           """An error occured while trying to apply the transformation: "{}".
    351           Batch instances: {},

ValueError: An error occured while trying to apply the transformation: " Cast string to float is not supported
	 [[{{node StatefulPartitionedCall/scale_to_0_1_3/Cast}}]] [Op:__inference_wrapped_finalized_8009]

Function call stack:
wrapped_finalized
".
          Batch instances: pyarrow.RecordBatch
clouds_all: large_list<item: int64>
  child 0, item: int64
date_time: large_list<item: large_binary>
  child 0, item: large_binary
day: large_list<item: int64>
  child 0, item: int64
day_of_week: large_list<item: int64>
  child 0, item: int64
holiday: large_list<item: large_binary>
  child 0, item: large_binary
hour: large_list<item: int64>
  child 0, item: int64
month: large_list<item: int64>
  child 0, item: int64
rain_1h: large_list<item: float>
  child 0, item: float
snow_1h: large_list<item: float>
  child 0, item: float
temp: large_list<item: float>
  child 0, item: float
traffic_volume: large_list<item: int64>
  child 0, item: int64
weather_description: large_list<item: large_binary>
  child 0, item: large_binary
weather_main: large_list<item: large_binary>
  child 0, item: large_binary,
          Fetching the values for the following Tensor keys: {'compute_and_apply_vocabulary_2/vocabulary/Reshape', 'compute_and_apply_vocabulary_1/vocabulary/Reshape', 'scale_to_0_1_2/min_and_max/Identity_1', 'scale_to_0_1_1/min_and_max/Identity_1', 'scale_to_0_1_1/min_and_max/Identity', 'scale_to_0_1_2/min_and_max/Identity', 'mean/mean_and_var/div_no_nan', 'scale_to_0_1_4/min_and_max/Identity_1', 'inputs_7_copy', 'scale_to_0_1_5/min_and_max/Identity', 'scale_to_0_1_3/min_and_max/Identity_1', 'compute_and_apply_vocabulary/vocabulary/Reshape', 'scale_to_0_1/min_and_max/Identity_1', 'scale_to_0_1_4/min_and_max/Identity', 'compute_and_apply_vocabulary_3/vocabulary/Reshape', 'mean/mean_and_var/div_no_nan_1', 'mean/mean_and_var/zeros', 'scale_to_0_1/min_and_max/Identity', 'scale_to_0_1_5/min_and_max/Identity_1', 'scale_to_0_1_3/min_and_max/Identity', 'mean/mean_and_var/Cast_1'}. [while running 'AnalyzeAndTransformDataset/AnalyzeDataset/ApplySavedModel[Phase0]/ApplySavedModel']

One step further but get this message in grader:

Failed test case: preprocessing_fn has incorrect type.
Expected:
typing.Callable,
but got:
<class ‘NoneType’>.

The NoneType error was due to “grade-to-here” issue

65/70 point on the grader.

The last error from the grader I am not able to find a solution on:

Failed test case: transformed_data incorrectly defined (showing changed values with respect to correct answer).
Expected:
{},
but got:
{“root[0][‘traffic_volume_xf’]”: {‘new_value’: 1, ‘old_value’: 0}, “root[2][‘traffic_volume_xf’]”: {‘new_value’: 1, ‘old_value’: 0}, “root[3][‘traffic_volume_xf’]”: {‘new_value’: 1, ‘old_value’: 0}, “root[4][‘traffic_volume_xf’]”: {‘new_value’: 1, ‘old_value’: 0}}.

Are you using any global variables?

Yes: top_k=_VOCAB_SIZE,num_oov_buckets=_OOV_SIZE

Please click my name and message your notebook as an attachment.

There is a bug at your end.
preprocessing_fn aims to populate outputs dictionary.
# Use tf.cast to cast the label key to float32 refers to casting the label field of the inputs. The label field refers to _VOLUME_KEY. We basically want to find rows where the label value is greater than the mean value of the same field.

Please fix the assignment statement of traffic_volume.

2 Likes

Hello Balaji,

I have the same error even though my traffic_volume looks right to me. Would you please look at my notebook as well?

Thanks,
Shreyas

Please click my name and message your notebook as an attachment.