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

integer out of bounds #12

Closed
davidhoover opened this issue Jul 10, 2024 · 2 comments
Closed

integer out of bounds #12

davidhoover opened this issue Jul 10, 2024 · 2 comments

Comments

@davidhoover
Copy link

I installed cryopros like this:

conda create --yes -n CRYOPROS_ENV python==3.12
conda activate CRYOPROS_ENV
pip install torch==2.3.1 torchvision==0.18.1 --extra-index-url https://download.pytorch.org/whl/cu118
wget https://github.com/mxhulab/cryopros/blob/main/cryoPROS-1.0-cp312-cp312-linux_x86_64.whl
git clone https://github.com/mxhulab/cryopros.git
cd cryopros
pip install cryoPROS-1.0-cp312-cp312-linux_x86_64.whl

I downloaded all the example files and ran this command:

cryopros-train \
--opt ${CONDA_ENV_PATH}/lib/python3.12/site-packages/cryoPROS/options/train.json \
--gpu_ids 0 1 2 3 \
--task_name HAtrimer_iteration_1 \
--box_size 256 \
--Apix 1.31 \
--volume_scale 50 \
--init_volume_path 6idd_align_lp10.mrc \
--data_path T00_HA_130K-Equalized-Particle-Stack.mrcs \
--param_path autorefinement.star \
--invert \
--dataloader_batch_size 8

I got this error:

Traceback (most recent call last):
  File "/usr/local/apps/cryopros/1.0.0/mamba/envs/CRYOPROS_ENV/bin/cryopros-train", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "cryoPROS/main_train.py", line 115, in cryoPROS.main_train.main
  File "/usr/local/apps/cryopros/1.0.0/mamba/envs/CRYOPROS_ENV/lib/python3.12/site-packages/cryoPROS/data/dataset.py", line 25, in __init__
    with mrcfile.mmap(self.data_path, mode='r', permissive=True) as mrc:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/apps/cryopros/1.0.0/mamba/envs/CRYOPROS_ENV/lib/python3.12/site-packages/mrcfile/load_functions.py", line 268, in mmap
    return MrcMemmap(name, mode=mode, permissive=permissive)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/apps/cryopros/1.0.0/mamba/envs/CRYOPROS_ENV/lib/python3.12/site-packages/mrcfile/mrcfile.py", line 115, in __init__
    self._read(header_only)
  File "/usr/local/apps/cryopros/1.0.0/mamba/envs/CRYOPROS_ENV/lib/python3.12/site-packages/mrcfile/mrcfile.py", line 131, in _read
    super(MrcFile, self)._read(header_only)
  File "/usr/local/apps/cryopros/1.0.0/mamba/envs/CRYOPROS_ENV/lib/python3.12/site-packages/mrcfile/mrcinterpreter.py", line 173, in _read
    self._read_data()
  File "/usr/local/apps/cryopros/1.0.0/mamba/envs/CRYOPROS_ENV/lib/python3.12/site-packages/mrcfile/mrcmemmap.py", line 112, in _read_data
    self._open_memmap(dtype, shape)
  File "/usr/local/apps/cryopros/1.0.0/mamba/envs/CRYOPROS_ENV/lib/python3.12/site-packages/mrcfile/mrcmemmap.py", line 121, in _open_memmap
    self._data = np.memmap(self._iostream,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/apps/cryopros/1.0.0/mamba/envs/CRYOPROS_ENV/lib/python3.12/site-packages/numpy/_core/memmap.py", line 277, in __new__
    bytes -= start
OverflowError: Python integer 34078721024 out of bounds for int32

Any clue what to do?

@zhengdihan
Copy link
Contributor

Hi,

It appears this issue is related to numpy>=2.0.0.
Using numpy==1.26.4 should solve this problem.

@davidhoover
Copy link
Author

Aha, yes, that worked:

conda create --yes -n CRYOPROS_ENV python==3.12 numpy==1.26.4

Thank you!

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