[英]OSError: [WinError 123] when I create kfp component
I'm trying to create a pipeline in Vertex AI with kfp using my own components from local notebook in Spyder.我正在尝试使用我自己的组件在 Spyder 的本地笔记本中使用 kfp 在 Vertex AI 中创建管道。
When I run the following piece of code:当我运行以下代码时:
@component(base_image="python:3.9", packages_to_install=["pandas"])
def create_dataset(
gcs_csv_path_train: str,
dataset: Output[Dataset],
):
import pandas as pd
df = pd.read_csv(gcs_csv_path_train)
dataset = df.pop('Class')
I get the following error:我收到以下错误:
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<ipython-input-11-b28c15ec667f>'
The error is not raised if I use a Jupyter notebook online.如果我在线使用 Jupyter 笔记本,则不会引发该错误。
What am I doing wrong?我究竟做错了什么? Thanks.谢谢。
You need to check the file path that you use in your code.您需要检查您在代码中使用的文件路径。 Because there are some characters that are not accepted such as the colon “ : ” in Windows file names.因为有些字符是不被接受的,比如 Windows 文件名中的冒号“:”。 You can see more documentation about Windows standar paths.您可以查看有关 Windows 标准路径的更多文档。
When using the path in the python code, please follow below:在python代码中使用路径时,请遵循以下操作:
Correct file path is as below正确的文件路径如下
filepath = r'C:\Test\file\file-input-thecodebuzz.txt'
OR或者
filepath = r"C:\Test\file\file-input-thecodebuzz.txt"
You can see more documentation .您可以查看更多文档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.