I guess that many people in the issue cannot reproduce your results because you use os.listdir in your code to obtain the dirs and then divide the training set and test set. Once the host is changed, the order of the files obtained by os.listdir is not the same. The same, so the data set we finally divided is different from your data set. I tried to print the directory order obtained by os.listdir on the two hosts and found that it was inconsistent. @ge-xing
作者您好! 我猜测在issue种很多人无法复现您的结果是因为您在您的代码种用os.listdir获得目录然后再划分训练集和测试集,一旦更换主机,os.listdir得到的文件的顺序是不一样的,所以我们最终划分的数据集和您的数据集是不一样的。我分别尝试在两台主机上打印os.listdir获得的目录顺序,发现其不一致。
主机一:
主机二:
我建议您对os.listdir后的all_dirs进行排序后再划分数据集!
I guess that many people in the issue cannot reproduce your results because you use os.listdir in your code to obtain the dirs and then divide the training set and test set. Once the host is changed, the order of the files obtained by os.listdir is not the same. The same, so the data set we finally divided is different from your data set. I tried to print the directory order obtained by os.listdir on the two hosts and found that it was inconsistent. @ge-xing