Giter Club home page Giter Club logo

Comments (9)

lukas-blecher avatar lukas-blecher commented on May 17, 2024 1

Thank you!
I missed an argument. It should work now.
Let me know if there are any other problems.

from latex-ocr.

lukas-blecher avatar lukas-blecher commented on May 17, 2024 1

No problem!
The thing with the file is a bug right now. I've discovered it a while back, but I'm currently not really allowed to commit to this repo.
If you don't have a nvidia GPU in your system, that is handeled automatically (--no-cuda isn't needed, but also doesn't change anything)

From the error message it looks like torchvision is the problem here.
Try to reinstall that package

from latex-ocr.

aleksandar-vuckovic avatar aleksandar-vuckovic commented on May 17, 2024 1

Oh you're right, I don't know how I missed that torchvision was the problem.
The issue was that I had the Arch-package python-pytorch installed, while torch and torchvision were installed via pip. It seems that it tried to use the system-provided torch and the pip-provided torchvision.
Uninstalling the python-pytorch package and reinstalling torch and torchvision via pip fixed it, and everything seems to work now. Thanks.

from latex-ocr.

lukas-blecher avatar lukas-blecher commented on May 17, 2024

Feel free to reopen if the issue is not resolved.

from latex-ocr.

aleksandar-vuckovic avatar aleksandar-vuckovic commented on May 17, 2024

I am sorry if this is the wrong place to ask this, but I have a similar issue. When I start latexocr (GUI) or the command line program, I get the following error message:

UserWarning: Failed to load image Python extension: libc10_cuda.so: cannot open shared object file: No such file or directory
regardless if I start them with --no-cuda or not.

I should add that I installed the package via pip, did no additional training, and am running Arch with Python v3.10.5 .

from latex-ocr.

lukas-blecher avatar lukas-blecher commented on May 17, 2024

Looks more like a broken installation to me. Can you confirm the pytorch installation is valid?
This particular issue is resolved, I believe.

from latex-ocr.

aleksandar-vuckovic avatar aleksandar-vuckovic commented on May 17, 2024

I think so, at least running to commands provided in https://pytorch.org/get-started/locally/ worked fine. For the GUI application, it starts while throwing this error message, but hangs when trying to snip a formula.

from latex-ocr.

lukas-blecher avatar lukas-blecher commented on May 17, 2024

How about

import torch
print(torch.randn(2, device='cuda'))

and does the cli work?

from latex-ocr.

aleksandar-vuckovic avatar aleksandar-vuckovic commented on May 17, 2024

First of all, I want to say that I appreciate you answering this fast and helping me.
The python commands print

>>> import torch
>>> print(torch.randn(2, device='cuda'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.10/site-packages/torch/cuda/__init__.py", line 211, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

which is to be expected, as my GPU is an AMD R9 290 and not nvidia, which is why I tried the "--no-cuda" flag.
The CLI output is

 $ pix2tex -f Screenshot.png --no-cuda 
/home/username/.local/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libc10_cuda.so: cannot open shared object file: No such file or directory
  warn(f"Failed to load image Python extension: {e}")

Predict LaTeX code for image ("?"/"h" for help). 

It seemingly ignores that I already specified a file. The only thing which does not just print the prompt again is when I enter the absolute path of the file, where it segfaults.

from latex-ocr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.