pandas报DataFrame object has no attribute 'dim'解决办法
train_df = pd.read_csv('../Titanic/train.csv')
X_train = train_df.drop("Survived", axis=1)
利用神经网络训练时报错,DataFrame object has no attribute ‘dim’
解决方法:
x_train = torch.from_numpy(np.array(X_train))
将Dataframe转化为numpy数组即可