如何在BlueData上使用Tensorflow从datatap读取和写入数据?

2024-10-01 22:30:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我希望能够直接从TensorFlow使用BlueData的datatap

有了pyspark,我可以做如下事情:

df.write.parquet('dtap://OtherDataTap/airline-safety_zero_incidents.parquet')

请注意,我不需要设置任何库—它已经准备就绪

从Tensorflow通过DataTap读取/写入数据需要做什么


Tags: dftensorflow事情pysparkwriteincidentszerosafety
1条回答
网友
1楼 · 发布于 2024-10-01 22:30:02

根据文件:http://docs.bluedata.com/40_datatap-tensorflow-support

import tensorflow as tf
import os
from tensorflow.python.framework.versions import CXX11_ABI_FLAG

CXX11_ABI_FLAG

bdfs_file_system_library = os.path.join("/opt/bluedata","libbdfs_file_system_shared_r1_9.so")
tf.load_file_system_library(bdfs_file_system_library)

with tf.gfile.Open("dtap://TenantStorage/tmp/tensorflow/dtap.txt", 'w') as f:
    f.write("This is the dtap test file")

with tf.gfile.Open("dtap://TenantStorage/tmp/tensorflow/dtap.txt", 'r') as f:
    content = f.read() 

相关问题 更多 >

    热门问题