floydhub / floyd-docs

FloydHub's documentation code. Contributions welcome!
https://docs.floydhub.com/
63 stars 65 forks source link

Unable to execute python code in floyd. Uploaded data to floyd and referenced file path in the code, but still facing issue. #178

Closed AnilPavanK closed 6 years ago

AnilPavanK commented 6 years ago

I'm having trouble using uploaded datasets in my code with following errors:

Job Logs: 2018-10-07 02:02:28 PSTFile "chatbot.py", line 13, in 2018-10-07 02:02:28 PSTlines = open('/Dataset/movie_lines/movie_lines.txt', encoding = 'utf-8', errors='ignore').read().split('\n') 2018-10-07 02:02:28 PSTFileNotFoundError: [Errno 2] No such file or directory: '/Dataset/movie_lines/movie_lines.txt'

Dataset location: floyd run --data skyfall/datasets/chatbot/1:movie_lines floyd run --data skyfall/datasets/chatbot/1:movie_conversations

python code: Importing the dataset lines = open('/movie_lines/movie_lines.txt', encoding = 'utf-8', errors='ignore').read().split('\n') conversations = open('/movie_conversations/movie_conversations.txt', encoding = 'utf-8', errors='ignore').read().split('\n')

Do I need to make any changes in my code?

whatrocks commented 6 years ago

Yes, you will need to adjust your code to reference where the datasets are mounted (which in your case will be /floyd/input/movie_lines and /floyd/input/movie_conversations. Here is a guide that you can reference with more details about dataset attaching: https://docs.floydhub.com/guides/data/mounting_data/#the-data-flag

Please reach out to support@floydhub.com if you have other questions.