Colab not recognising an existing directory

95 Views Asked by At

I have been trying to run an openpose model on colab but havent been able to do so because Colab doesn't recognise the directory. Screenshot of code

I have provided the code screenshot in this message, any help or direction will be highly appreciated!

Edit 1: A modification from the first answer

code:

!cd openpose && ./build/examples/openpose/openpose.bin -image_dir /drive/My\ Drive/research_project/Fall\ Detection/$category/testdata/video$video  --render_pose 0 --disable_blending -keypoint_scale 3 --display 0 -write_json /drive/My\ Drive/research_project/Fall\ Detection/$category/jsondata/video$video

output:

    Error:
           Folder /drive/My Drive/research_project/Fall Detection/Coffee_room/testdata/video0/ does not exist.
2

There are 2 best solutions below

0
On

with the %cd operation you already moved yourself to [...]/Coffee_room/testdata, so when you try and os.chdir command, it throws an error. At least I think so, the screenshot doesn't let me copy the code to try and recreate the same situation, so it's a bit hard

Try to put your code in the right format inside the question like this

print('Hello, this is my code')
2
On

I believe you need to remove the '..', as you are already in the '/content' folder from the os.chdir('/content') command

If that's not it, you also have a missing '/research project' after '/My Drive' in the line before the last