pycharm remote server loading data set can not find the path problem

insert image description here

[Project practice] The path of the data set referenced by the python file path
has been set incorrectly. I have tried the absolute path, but the relative path does not work. Then I read a few blogs about relative paths, as above, it still doesn't work.

Finally, use the code (this code is very easy to use, come from whoring)

data_root = os.path.abspath(os.path.join(os.getcwd(), "../.."))  # get data root path

It is found that the path is not in the C drive, but in the remote server

/home/jianxiaxu/test

Only then did I realize that the path of this data set has been set incorrectly. It may be because the python interpreter of the remote server will call the data set on the remote server by default. The path of the data set here cannot be copied in pycharm, but should be copied on the remote server. file path.

insert image description here

/home/jianxiaxu/test/data_set/flower_data/flower_photos

So far, the problem has been solved.

Guess you like

Origin blog.csdn.net/verse_armour/article/details/128501200