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.

Automated testing discovered that `image::read_png` sometimes can not be initialized on Windows

See original GitHub issue

🐛 Describe the bug

See https://github.com/pytorch/pytorch.github.io/runs/4042987825?check_suite_focus=true Several Windows configuration tests of torchvision failed with No such operator image::decode_png

Versions

0.11.1

cc @peterjc123 @nbcsm @guyang3532 @maxluk @gunandrose4u @mszhanyi

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
peterjc123commented, Nov 8, 2021

I think the cause of this problem is quite clear. First, In PyTorch, we use LoadLibraryEx and then LoadLibrary to load in the dependencies, but in torchvision, it relies on torch.ops.load_library, which uses ctypes.CDLL. (It uses LoadLibrary as the underlying API.) The behavior is inconsistent. Second, in PyTorch, we use AddDllDirectory and PATH for dependency resolving, but we do nothing when torch.ops.load_library is called. Actually, we should do the same, that is to add the directory containing the DLLs for dependency search.

Links:

  1. pytorch init dependencies: https://github.com/pytorch/pytorch/blob/master/torch/__init__.py#L95-L136
  2. pytorch torch.ops.load_library: https://github.com/pytorch/pytorch/blob/master/torch/_ops.py#L84-L111
  3. torchvision init dependencies: https://github.com/pytorch/vision/blob/main/torchvision/extension.py#L13-L19
1reaction
andfoycommented, Nov 3, 2021

and why do we bundle those libraries as dynamic dependencies instead of compiling them in?

It was easier when packaging the wheels, but statically compiling it into the image extension should fix these kind of issues indeed. However, OpenCV and other libraries also opt to dynamically link to libpng and other libraries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot the Regression suite automation tool
Typically, this error happens when the test environment has not been configured to trust the certificate that RSAT is using for authentication.
Read more >
6 Common Test Automation Mistakes And How To Avoid Them
Success in software test automation is less about getting it right and more about avoiding mistakes. Here are six common errors and how...
Read more >
Setting up your own test automation environment
This module should have proven fun, and should have given you enough of an insight into writing and running automated tests for you...
Read more >
Using xUnit to Test your C# Code - Auth0
Test Automation Basics. Testing ensures that your application is doing what it's meant to do. It seems a trivial statement, but sometimes this...
Read more >
Automation in Selenium: Page Object Model and Page Factory
Proper test automation is the key to quality software. ... elements need to be initialized using Page Factory before the web element variables...
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