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

Code incompatibility problem #638

Closed
megamattc opened this issue Sep 15, 2024 · 3 comments
Closed

Code incompatibility problem #638

megamattc opened this issue Sep 15, 2024 · 3 comments

Comments

@megamattc
Copy link

megamattc commented Sep 15, 2024

I have been having trouble building the conda environment specified by environment.yml within a virtual python environment (venv) for python 3.12.3. When I run

conda env create -f environment.yml

in that environment, it gets stuck on 'Solving environment'.

I am using environment.yml because I am trying to fine-tine the OCR models in the CuReD repository (https://github.com/DigitalPasts/CuReD) and this is what their instructions recommend. Trying to set up kraken other ways such as simply using pip or conda without the yml file lead to version incompatibilities when using kraken or ketos.

@mittagessen
Copy link
Owner

mittagessen commented Sep 16, 2024 via email

@megamattc
Copy link
Author

Hello,

Unfortunately, trying to build a conda environment using environment.yml file in

conda env create -f environment.yml

still leads to an endless 'Solving environments' problem. Also as before, when I build a simple conda environment with python 3.10 or 3.11, install kraken within it, and then try the ketos command ketos transcribe --prefill model_filename -o html_filename.html image1.png, I get the same error again:

Reading images ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0% 0/1 -:--:-- 0:00:00WARNING:kraken:Input test.png is in RGBA color mode. Converting to RGB
Reading images ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0% 0/1 -:--:-- 0:00:01
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/ubuntu/anaconda3/envs/con9/bin/ketos:8 in <module>                                         │
│                                                                                                  │
│   5 from kraken.ketos import cli                                                                 │
│   6 if __name__ == '__main__':                                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│ ❱ 8 │   sys.exit(cli())                                                                          │
│   9                                                                                              │
│                                                                                                  │
│ /home/ubuntu/anaconda3/envs/con9/lib/python3.11/site-packages/click/core.py:1157 in __call__     │
│                                                                                                  │
│ /home/ubuntu/anaconda3/envs/con9/lib/python3.11/site-packages/click/core.py:1078 in main         │
│                                                                                                  │
│ /home/ubuntu/anaconda3/envs/con9/lib/python3.11/site-packages/click/core.py:1688 in invoke       │
│                                                                                                  │
│ /home/ubuntu/anaconda3/envs/con9/lib/python3.11/site-packages/click/core.py:1434 in invoke       │
│                                                                                                  │
│ /home/ubuntu/anaconda3/envs/con9/lib/python3.11/site-packages/click/core.py:783 in invoke        │
│                                                                                                  │
│ /home/ubuntu/anaconda3/envs/con9/lib/python3.11/site-packages/click/decorators.py:33 in new_func │
│                                                                                                  │
│ /home/ubuntu/anaconda3/envs/con9/lib/python3.11/site-packages/kraken/ketos/transcription.py:206  │
│ in transcription                                                                                 │
│                                                                                                  │
│   203 │   │   │   │   │   except ValueError as e:                                                │
│   204 │   │   │   │   │   │   raise click.UsageError('{} invalid segmentation: {}'.format(line   │
│   205 │   │   │   if prefill:                                                                    │
│ ❱ 206 │   │   │   │   it = rpred.rpred(prefill, im_bin, res.copy())                              │
│   207 │   │   │   │   preds = []                                                                 │
│   208 │   │   │   │   logger.info('Recognizing')                                                 │
│   209 │   │   │   │   for pred in it:                                                            │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'Segmentation' object has no attribute 'copy'

@mittagessen
Copy link
Owner

mittagessen commented Sep 16, 2024 via email

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

2 participants