question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resource resolving not working for $PWD/ocrd-resources

See original GitHub issue

I have (due to some quick hack to check something) my models in a directory $PWD/ocrd-resources, according to the docs:

ocrd-resources
ocrd-resources/ocrd-calamari-recognize
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0/3.ckpt.json
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0/4.ckpt.h5
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0/1.ckpt.h5
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0/0.ckpt.h5
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0/2.ckpt.json
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0/2.ckpt.h5
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0/4.ckpt.json
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0/1.ckpt.json
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0/0.ckpt.json
ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0/3.ckpt.h5

ocrd-calamari-recognize fails to find these:

15:23:53.051 ERROR ocrd.ocrd-calamari-recognize.resolve_resource - Could not find resource 'qurator-gt4histocr-1.0' for executable 'ocrd-calamari-recognize'. Try 'ocrd resmgr download ocrd-calamari-recognize qurator-gt4histocr-1.0' to download this resource.

I believe that the code at https://github.com/OCR-D/core/blob/d4a853964ce468a2c0eb6be2004c15441fbd206f/ocrd_utils/ocrd_utils/os.py#L68 should read:

candidates.append(join(cwd, 'ocrd-resources', executable, fname))  # Added 'ocrd-resources', executable

I’m not submitting a PR because I don’t know if there are other reasons for leaving out 'ocrd-resources', executable here.

(If I’m putting the models into qurator-gt4histocr-1.0 instead of ocrd-resources/ocrd-calamari-recognize/qurator-gt4histocr-1.0, it works.)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kbacommented, Nov 24, 2021

I think so, but https://ocr-d.de/en/spec/ocrd_tool#file-parameters does not seem up to date yet? (My main issue is that the documentation does not match the behaviour)

Yes, there was an issue with the publishing workflow for the specs, has been fixed and site has been updated.

(And we should probably notify users via Gitter, even if the implemented behaviour has not changed.)

done

0reactions
bertskycommented, Nov 11, 2021

I think so, but https://ocr-d.de/en/spec/ocrd_tool#file-parameters does not seem up to date yet? (My main issue is that the documentation does not match the behaviour)

Indeed: that’s still the old version. https://github.com/OCR-D/spec/blob/master/ocrd_tool.md#file-parameters has it right, so the website needs to be updated. (And we should probably notify users via Gitter, even if the implemented behaviour has not changed.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: AEM 6.4 - Not able to access resource with below r...
This issue is related to get a resource with the help of system user ("someuser") having all permissions given to that user in...
Read more >
AEM resource resolver failing - sling - Stack Overflow
It looks like your configuration only affects resource resolution and not the outgoing mapping. The rule will be applied for incoming requests ...
Read more >
"cannot set user id: Resource temporarily unavailable" while ...
"cannot set user id: Resource temporarily unavailable" while trying to login or su as a local user in Red Hat Enterprise Linux.
Read more >
Cannot resolve variable at "provider.stage": Value not found at ...
When we are running the application the serverless file cant take the value from .env file. Taking out that flag(--env) it is running...
Read more >
Cannot create or start container instance (service unavailable)
Manually restarting the container instances did not work, ... network vnet show --resource-group $APP_RES_GROUP --name $VNET_NAME --query id ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found