【发布时间】:2022-01-25 16:57:50
【问题描述】:
在我的本地 Win10 机器上运行以下代码并遇到错误。
导入以下包:
import tensorflow as tf
import tensorflow_transform as tft
import tensorflow_transform.beam as tft_beam
from tensorflow_transform.tf_metadata import dataset_metadata
from tensorflow_transform.tf_metadata import schema_utils
import pprint
import tempfile
蟒蛇:3.7.11;窗户:10;张量流变换:1.5.0
# Ignore the warnings
tf.get_logger().setLevel('ERROR')
# a temporary directory is needed when analyzing the data
with tft_beam.Context(temp_dir=tempfile.mkdtemp()):
# define the pipeline using Apache Beam syntax
transformed_dataset, transform_fn = (
# analyze and transform the dataset using the preprocessing function
(raw_data, raw_data_metadata) | tft_beam.AnalyzeAndTransformDataset(
preprocessing_fn)
)
# unpack the transformed dataset
transformed_data, transformed_metadata = transformed_dataset
# print the results
print('\nRaw data:\n{}\n'.format(pprint.pformat(raw_data)))
print('Transformed data:\n{}'.format(pprint.pformat(transformed_data)))
错误快照:
usage: ipykernel_launcher.py [-h] [--dataflow_endpoint DATAFLOW_ENDPOINT]
[--project PROJECT] [--job_name JOB_NAME]
[--staging_location STAGING_LOCATION]
[--temp_location TEMP_LOCATION] [--region REGION]
[--service_account_email SERVICE_ACCOUNT_EMAIL]
[--no_auth]
[--template_location TEMPLATE_LOCATION]
[--label LABELS] [--update]
[--transform_name_mapping TRANSFORM_NAME_MAPPING]
[--enable_streaming_engine]
[--dataflow_kms_key DATAFLOW_KMS_KEY]
[--create_from_snapshot CREATE_FROM_SNAPSHOT]
[--flexrs_goal {COST_OPTIMIZED,SPEED_OPTIMIZED}]
[--dataflow_service_option DATAFLOW_SERVICE_OPTIONS]
[--enable_hot_key_logging]
ipykernel_launcher.py: error: argument --flexrs_goal: invalid choice: 'C:\\Users\\abc\\AppData\\Local\\Temp\\tmp-17163boS9n25ijAn.json' (choose from 'COST_OPTIMIZED', 'SPEED_OPTIMIZED')
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
有人可以帮忙吗?
【问题讨论】:
标签: python tensorflow windows-10 apache-beam