猿问

如何从github下载这些文件?

我使用 Windows 和 Python 的 Anaconda 发行版和 git bash 来读取 .sh 文件。我无法在此处安装文件: https ://github.com/TalwalkarLab/leaf/tree/master/data/femnist


我使用 git bash 和命令 git clone https://github.com/TalwalkarLab/leaf.git在 python 中克隆了叶文件夹


正如 /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

------------------------------

如果有人知道我应该做什么,那会对我有很大帮助。


提前谢谢大家,祝你有美好的一天!


翻阅古今
浏览 142回答 1
1回答

RISEBY

我注意到的第一件事是你说你的 shell 不知道 python3 是什么。这意味着您需要在计算机上实际安装 python3。重命名 python.exe 不是有效的解决方法。在您的终端中,您需要运行python3 --version.&nbsp;如果这没有向您返回 python3 版本号,那么您就知道您没有安装 python3。Python 3.7 可以从 Windows 商店或从https://www.python.org/downloads/windows/安装之后,并使用 重新克隆整个存储库git clone https://github.com/TalwalkarLab/leaf.git,您将需要使用pip3 install -r requirements.txt终端命令在存储库的根目录中安装自述文件中提到的软件包。从那里完成此高级安装,现在您可以使用cd data/femnist输入数据集的目录。最后,运行命令bash ./preprocess.sh。我遵循了这些确切的步骤(但是,我在 Mac OSX 上),并且能够以这种方式下载所有数据。请让我知道尝试我的解决方案的结果,如果可以的话,我很乐意提供更多见解!
随时随地看视频慕课网APP

相关分类

Python
我要回答