Open breisfeld opened 1 month ago
Modify alb.ElasticTransform( p=1, alpha=50, sigma=120 0.1, alpha_affine=120 0.01, border_mode=0, value=(255, 255, 255), ), to alb.ElasticTransform in transforms.py (p=1, alpha=50, sigma=120 * 0.1, alpha_affine=None, border_mode=0, value=(255, 255, 255), ),
@breisfeld
mode Even I changed the parameters, it shows the same warning
same issue
Modify alb.ElasticTransform( p=1, alpha=50, sigma=120 0.1, alpha_affine=120 0.01, border_mode=0, value=(255, 255, 255), ), to alb.ElasticTransform in transforms.py (p=1, alpha=50, sigma=120 * 0.1, alpha_affine=None, border_mode=0, value=(255, 255, 255), ),
That seemed to take care of the issue for me. Thanks!
Thanks
Modify alb.ElasticTransform( p=1, alpha=50, sigma=120 0.1, alpha_affine=120 0.01, border_mode=0, value=(255, 255, 255), ), to alb.ElasticTransform in transforms.py (p=1, alpha=50, sigma=120 * 0.1, alpha_affine=None, border_mode=0, value=(255, 255, 255), ),
It worked and the model started downloading. However, after downloading the model checkpoint, it immediately throws a connection error. (WSL2)
Can't even make a PR to fix this lol. They locked it down to collaborator-only.
I am having the same issues with nougat. I am new to OCR. Please assist me with where I should make the change for the ElasticTransform function or any other way. Thanks for any advice.
Modify alb.ElasticTransform( p=1, alpha=50, sigma=120 0.1, alpha_affine=120 0.01, border_mode=0, value=(255, 255, 255), ), to alb.ElasticTransform in transforms.py (p=1, alpha=50, sigma=120 * 0.1, alpha_affine=None, border_mode=0, value=(255, 255, 255), ),
Getting some strange error after making that edit,
No module named nougat.main; 'nougat' is a package and cannot be directly executed
Windows 11
Same error, Macbook pro Python 3.11.2
same issue
Traceback (most recent call last):
File "/home/dima/nougat/bin/nougat", line 5, in <module>
from predict import main
File "/home/dima/nougat/lib/python3.12/site-packages/predict.py", line 18, in <module>
from nougat import NougatModel
File "/home/dima/nougat/lib/python3.12/site-packages/nougat/__init__.py", line 7, in <module>
from .model import NougatConfig, NougatModel
File "/home/dima/nougat/lib/python3.12/site-packages/nougat/model.py", line 34, in <module>
from nougat.transforms import train_transform, test_transform
File "/home/dima/nougat/lib/python3.12/site-packages/nougat/transforms.py", line 146, in <module>
alb.ElasticTransform(
File "/home/dima/nougat/lib/python3.12/site-packages/albumentations/core/validation.py", line 35, in custom_init
config = dct["InitSchema"](**full_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dima/nougat/lib/python3.12/site-packages/pydantic/main.py", line 209, in __init__
validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for InitSchema
alpha_affine
Input should be None [type=none_required, input_value=1.2, input_type=float]
For further information visit https://errors.pydantic.dev/2.9/v/none_required
Try my fork for now, I merged the corresponding PRs:
python3 -m pip install git+https://github.com/SichangHe/facebookresearch--nougat.git
# Or, using Pipx:
pipx install git+https://github.com/SichangHe/facebookresearch--nougat.git
# Or, if you are using Rye:
rye add --git https://github.com/SichangHe/facebookresearch--nougat.git nougat-ocr
pip install albumentations==1.4.8
pip install albumentations==1.4.8
@SichangHe , should the existing line in setup.py
in your fork be replaced by this if it is the true dependency?
pip install albumentations==1.4.8
@SichangHe , should the existing line in
setup.py
in your fork be replaced by this if it is the true dependency?
I doublechecked, I have 1.4.14 in my environment and it still works.
Also, I am moving away to marker-pdf because it seems to give fewer spurious errors, although their header detection and math decoding really suck.
Instead of calling the nougat thing via the CLI, I chose to install nougat_api and it worked for me. That was sufficient for my use case.
Hi, When running
nougat
on a test pdf fileI get the following traceback:
I get the same traceback when running
nougat
with no arguments.I have tried running this same command under MacOS, Linux, and Windows. On all platforms,
nougat
was installed into a freshconda
virtual environment usingpip
.Any advice on solving the problem?
Thanks.