我有一个数据集写到一个totff.simulation.datasets.ClientData,文件中,我想要将它转换为上的表单h5。一周前,我用这个读到了
train_path='FederatedClients/dataTrain.h5'
train_data = tff.simulation.HDF5ClientData(train_path)但是现在,我再次得到了这个语句的以下错误。
----------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-6-f4c34c62ca50> in <module>
1 train_path='FederatedClients/dataTrain.h5'
2 #train_data=pd.read_hdf(train_path)
----> 3 train_data = tff.simulation.HDF5ClientData(train_path)
4 test_path='FederatedClients/dataTest.h5'
5 test_data=pd.read_hdf(test_path)
AttributeError: module 'tensorflow_federated.python.simulation' has no attribute 'HDF5ClientData'我不知道该怎么做了,我用最基本的熊猫来读取H5文件,我也得到了错误,TAT
train_data=pd.read_hdf(train_path)----------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-7-151fe098668c> in <module>
1 train_path='FederatedClients/dataTrain.h5'
----> 2 train_data=pd.read_hdf(train_path)
3 train_data = tff.simulation.HDF5ClientData(train_path)
4 test_path='FederatedClients/dataTest.h5'
5 test_data=pd.read_hdf(test_path)
~/anaconda3/envs/tff/lib/python3.7/site-packages/pandas/io/pytables.py in read_hdf(path_or_buf, key, mode, errors, where, start, stop, columns, iterator, chunksize, **kwargs)
437 if len(groups) == 0:
438 raise ValueError(
--> 439 "Dataset(s) incompatible with Pandas data types, "
440 "not table, or no datasets found in HDF5 file."
441 )
ValueError: Dataset(s) incompatible with Pandas data types, not table, or no datasets found in HDF5 file.如果你能解决我的问题,我将不胜感激。
https://stackoverflow.com/questions/68668322
复制相似问题