我对python没有太多的经验,但是我尝试了一些方法,但是对于这个错误还没有任何效果:InvalidArgumentError: Failed to create a directory: ./logsSat Jun 9
20:44:37 2018-training; Invalid argument
它发生在代码的一个简单部分,即创建一个文件来存储来自sklearn数据集的数据。以下是代码的一部分:epochs = 500
logpath = './logs'
resultpath = './results'
def main(epochs, logpath, resultpath):
# load the features of the dataset
features = datasets.load_breast_cancer().data
# standardize the features
features = StandardScaler().fit_transform(features)
# get the number of features
num_features = features.shape[1]
# load the labels for the features
labels = datasets.load_breast_cancer().target
train_features, test_features, train_labels, test_labels = train_test_split(features, labels, test_size=0.20,
stratify=labels)
model = MLP.MLP(alpha=LEARNING_RATE, batch_size=BATCH_SIZE, node_size=NUM_NODES, num_classes=NUM_CLASSES,
num_features=num_features)
model.train(num_epochs=epochs, log_path=logpath, train_data=[train_features, train_labels],
train_size=train_features.shape[0], test_data=[test_features, test_labels],
test_size=test_features.shape[0], result_path=resultpath)
显然,'/logs'不是我应该如何输入该目录名的,所以有什么想法可以让它工作吗?我尝试过只使用目录名、完整路径和系统路径追加(“.”)语法,但我一直得到相同的错误。在