【发布时间】:2020-09-30 02:24:59
【问题描述】:
我使用 windows 和 Python 的 Anaconda 发行版和 git bash 来读取 .sh 文件。我无法在此处安装文件: https://github.com/TalwalkarLab/leaf/tree/master/data/femnist
我使用 git bash 和命令在 python 中克隆了叶子文件夹 git克隆https://github.com/TalwalkarLab/leaf.git
正如 /femnist 中的 readme.md 文件所建议的那样,我尝试运行 preprocess.sh(首先没有特定参数)
我一开始遇到了麻烦,因为shell不知道“python3”是什么,所以我复制了“python.exe”并将其重命名为“python3.exe”。
当我使用 cd {path where we can find preprocess.sh} 进入 git bash 时,我尝试运行 preprocess.sh 并获得:
IS234906+admin-local@IS234906 MINGW64 ~/Desktop/CEA/femnist/leaf/data/femnist (master)
$ ./preprocess.sh
------------------------------
extracting file directories of images
Traceback (most recent call last):
File "get_file_dirs.py", line 27, in <module>
classes = os.listdir(class_dir)
FileNotFoundError: [WinError 3] The specified path cannot be found: 'C:\\Users\\admin-local\\Desktop\\CEA\\femnist\\leaf\\data\\femnist\\data\\raw_data\\by_class'
finished extracting file directories of images
------------------------------
calculating image hashes
Traceback (most recent call last):
File "get_hashes.py", line 15, in <module>
class_file_dirs = util.load_obj(cfd)
File "C:\Users\admin-local\Desktop\CEA\femnist\leaf\data\utils\util.py", line 10, in load_obj
with open(name + '.pkl', 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\admin-local\\Desktop\\CEA\\femnist\\leaf\\data\\femnist\\data\\intermediate\\class_file_dirs.pkl'
finished calculating image hashes
------------------------------
assigning class labels to write images
Traceback (most recent call last):
File "match_hashes.py", line 14, in <module>
class_file_hashes = util.load_obj(cfhd) # each elem is (class, file dir, hash)
File "C:\Users\admin-local\Desktop\CEA\femnist\leaf\data\utils\util.py", line 10, in load_obj
with open(name + '.pkl', 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\admin-local\\Desktop\\CEA\\femnist\\leaf\\data\\femnist\\data\\intermediate\\class_file_hashes.pkl'
finished assigning class labels to write images
------------------------------
grouping images by writer
Traceback (most recent call last):
File "group_by_writer.py", line 13, in <module>
write_class = util.load_obj(wwcd)
File "C:\Users\admin-local\Desktop\CEA\femnist\leaf\data\utils\util.py", line 10, in load_obj
with open(name + '.pkl', 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\admin-local\\Desktop\\CEA\\femnist\\leaf\\data\\femnist\\data\\intermediate\\write_with_class.pkl'
finished grouping images by writer
------------------------------
converting data to .json format
Traceback (most recent call last):
File "data_to_json.py", line 43, in <module>
writers = util.load_obj(by_writer_dir)
File "C:\Users\admin-local\Desktop\CEA\femnist\leaf\data\utils\util.py", line 10, in load_obj
with open(name + '.pkl', 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\admin-local\\Desktop\\CEA\\femnist\\leaf\\data\\femnist\\data\\intermediate\\images_by_writer.pkl'
finished converting data to .json format
------------------------------
calculating JSON file checksums
checksums written to meta/dir-checksum.md5
如果有人知道我应该怎么做,那对我有很大帮助。
在此先感谢大家,祝您有美好的一天!
【问题讨论】: