Forums

File is in directory but error log says it does not exist

I have the file saved_model.pb inside of the directory: /home/shaanluthra/Swift-Summarizer/api/sentEncoder/saved_model.pb

When I am inside another python file INSIDE THE API DIRECTORY trying to call the saved_model.pb file, my path is: ./sentEncoder/saved_model.pb

However I am getting the error: OSError: SavedModel file does not exist at: ./sentEncoder/saved_model.pb

The file is clearly there I dont know why this file can not be found on python anywhere. This code with the same directory paths worked when I ran it locally.

Any advice would be greatly appreciated.

I found the solution by putting the entire path:

/home/shaanluthra/Swift-Summarizer/api/sentEncoder/saved_model.pb

instead of just

./sentEncoder/saved_model.pb

ah great! that is probably because you have a different working directory when running your webapp vs when running locally