TypeError: Could not build a TypeSpec for...;Can‘t convert non-rectangular Python sequenceto tensor
2020-07-25 16:53
5620 查看
TypeError: Could not build a TypeSpec for...;ValueError:Can't convert non-rectangular Python sequenceto tensor
在修改tensorflow2.0版本的代码时出现以下错误:
参考文章,在代码中加入
values:
数据是dataframe
trainData=pd.read_csv(trainDataPath, header = None) firstProteinArrayTrain = trainData.iloc[:, 0:2401] secondProteinArrayTrain = trainData.iloc[:, 2401:4802] thirdProteinArrayTrain = np.array(trainData.iloc[:,-1].tolist())
trainDataset=tf.data.Dataset.from_tensor_slices( ( firstProteinArrayTrain.values,secondProteinArrayTrain.values, thirdProteinArrayTrain)).shuffle(1000).batch(30)
相关文章推荐
- python readline读文件,并且将其转化为数字形式时:ValueError: could not convert string to float:...
- python中ValueError: could not convert string to float:如何修改?
- TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor
- python:字符串和数字拼接 (TypeError: Can't convert 'int' object to str implicitly)
- python学习笔记(一) python3: urlopen()使用出现TypeError: can't convert 'bytes' object to str implicitly...
- SSD-Tensorflow:TypeError: Can not convert a tuple into a Tensor or Operation
- Tensorflow Typeerror: Can not convert a ndarray into a Tensor or Operation**
- TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory fi
- Error:Could not get unknown property ‘apkVariantData’ for object of type com.android.build.gradle.in
- bug—TypeError: only length-1 arrays can be converted to Python scalars
- Could not store transport type data for Receive Location 'Recv.Loc' to config store. Primary SSO Server 'Sql-server' failed. The external credentials in the SSO database are more recent.
- python 3.5: TypeError: a bytes-like object is required, not 'str' when writing to a file
- python 3.5 报错TypeError:can't concat str to bytes 、TypeError: write() argument must be str, not bytes
- Pip "Could not install packages due to an EnvironmentError: Missing dependencies for SOCKS support."
- SSD-Tensorflow-masterc测试时:TypeError: Can not converrt a tuple int aTensor or Operation.或_variable_v2
- [ERROR] Failed to execute goal on project sypro: Could not resolve dependencies for project sy.demo:
- Error:Unable to start the daemon process: could not reserve enough space for object heap.
- 基于sklearn的线性回归中,引入多维数组出现TypeError: only size-1 arrays can be converted to Python scalars
- tensorflow.python.framework.errors_impl.UnknownError: Could not start gRPC server
- 错误:TypeError: can't multiply sequence by non-int of type 'numpy.float64'