Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path does not exist error while creating custom dataset #65

Closed
omersert opened this issue Sep 5, 2019 · 6 comments
Closed

path does not exist error while creating custom dataset #65

omersert opened this issue Sep 5, 2019 · 6 comments

Comments

@omersert
Copy link

omersert commented Sep 5, 2019

Hi I wanted to create my own dataset I used these instructions https://github.com/clovaai/deep-text-recognition-benchmark#when-you-need-to-create-lmdb-dataset
When I issue the command
python3 create_lmdb_dataset.py --inputPath data/ --gtFile data/gt.txt --outputPath result/
I get the eror
image

it says the path does not exist but it actually exists.
What can I do to prevent this error?

@inouetaka
Copy link

@omersert
Does the path written in gtFile match the actual path?

@omersert
Copy link
Author

omersert commented Sep 6, 2019

Yes they're identical.

@ku21fan
Copy link
Contributor

ku21fan commented Sep 6, 2019

Hello,

I guess something would be wrong..
I doubted the actual path as @inouetaka said.

I wonder the output of os.path.exists(imagePath).
Can you add and print the result of print(os.path.exists(imagePath)) as below?

        print(os.path.exists(imagePath)) <-- add this at Line 53 in create_lmdb_dataset.py
        if not os.path.exists(imagePath):
            print('%s does not exist' % imagePath)
            continue

@omersert
Copy link
Author

omersert commented Sep 6, 2019

@ku21fan Hi,
I did what you said and here is what I got as an output
image
and this is a screenshot from my gt.txt file
image

@ku21fan
Copy link
Contributor

ku21fan commented Sep 6, 2019

@omersert
I found the cause and solution!

It related on os.path.join function.
스크린샷_090619_054429_PM
If the second argument started with /home/ (specifically /), the first argument (= inputPath =data/ ) was ignored.
It was unexpectable for me, I didn't know this case of os.path.join function.
Sorry about that.

So, can you make and try with new_gt.txt file?
which removed /home/~~~~~-benchamrk/data/ in each line.
i.e. change from /home/~~~~~-benchamrk/data/resimler/res_30001_0000166--.jpg to resimler/res_30001_0000166--.jpg

Best

@omersert
Copy link
Author

omersert commented Sep 6, 2019

@ku21fan Now it works fine.
Thank you so much.

@ku21fan ku21fan closed this as completed Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants