使用Floyd时如何使用PC上的数据文件?
运行后:
floyd init
floyd run --gpu --env tensorflow-1.3 "python model.py"
我在日志中看到:
data = pd.read_csv(r'C:\Users\barte\Desktop\Projects\tf\drugs review\drugsComTest_raw.csv')
此示例不起作用,我得到了这样的日志:
2019-10-26 09:21:49 PSTStarting container...
2019-10-26 09:21:49 PST
################################################################################
2019-10-26 09:21:49 PSTRun Output:
2019-10-26 09:21:49 PSTStarting services.
2019-10-26 09:21:51 PSTUsing TensorFlow backend.
2019-10-26 09:22:03 PSTTraceback (most recent call last):
2019-10-26 09:22:03 PSTFile "model.py", line 17, in <module>
2019-10-26 09:22:03 PSTdata = pd.read_csv('drugs review\drugsComTest_raw.csv',usecols=['review','rating'])
2019-10-26 09:22:03 PSTFile "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 655, in parser_f
2019-10-26 09:22:03 PSTreturn _read(filepath_or_buffer, kwds)
2019-10-26 09:22:03 PSTFile "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 405, in _read
2019-10-26 09:22:03 PSTparser = TextFileReader(filepath_or_buffer, **kwds)
2019-10-26 09:22:03 PSTFile "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 764, in __init__
2019-10-26 09:22:03 PSTself._make_engine(self.engine)
2019-10-26 09:22:03 PSTFile "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 985, in _make_engine
2019-10-26 09:22:03 PSTself._engine = CParserWrapper(self.f, **self.options)
2019-10-26 09:22:03 PSTFile "/usr/local/lib/python3.6/site-packages/pandas/io/parsers.py", line 1605, in __init__
2019-10-26 09:22:03 PSTself._reader = parsers.TextReader(src, **kwds)
2019-10-26 09:22:03 PSTFile "pandas/_libs/parsers.pyx", line 394, in pandas._libs.parsers.TextReader.__cinit__ (pandas/_libs/parsers.c:4209)
2019-10-26 09:22:03 PSTFile "pandas/_libs/parsers.pyx", line 710, in pandas._libs.parsers.TextReader._setup_parser_source (pandas/_libs/parsers.c:8873)
2019-10-26 09:22:03 PSTFileNotFoundError: File b'drugs review\\drugsComTest_raw.csv' does not exist
最佳答案
您应该将文件放在floyd init
目录中。然后将其复制到Floyd集线器。
关于python - 使用floyd时管理文件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58577626/