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

When I run the command:dvc repro,the ERROR: unexpected error - module 'numpy' has no attribute 'int'. How to fix it? #2

Open
aspnetcs opened this issue Apr 5, 2024 · 8 comments

Comments

@aspnetcs
Copy link

aspnetcs commented Apr 5, 2024

https://github.com/MIR-MU/ARQMath-data-preprocessing.
When I run the command:dvc repro,the ERROR: unexpected error - module 'numpy' has no attribute 'int'.

How to fix it?

@PetrSojka
Copy link
Member

PetrSojka commented Apr 5, 2024 via email

@Witiko
Copy link
Member

Witiko commented Apr 5, 2024

While @PetrSojka's advice would be helpful if you saw a similar issue when running your own code, it doesn't help you much in the context of running a third-party library dvc.

In requirements.txt, we have an ancient version of the dvc library (0.92.0 from April 2, 2020), which apparently does not play well with the current version of the numpy library. You should either update the dvc library to the current version (3.49.0 from March 26, 2024) using the command pip install -U dvc or downgrade the numpy library to the version 1.18.2 from March 17, 2020 using the command pip install numpy==1.18.2.

Please, let us know if either of these options helped you fix your issue.

@aspnetcs
Copy link
Author

aspnetcs commented Apr 7, 2024 via email

@aspnetcs
Copy link
Author

aspnetcs commented Apr 7, 2024 via email

@aspnetcs
Copy link
Author

aspnetcs commented Apr 7, 2024 via email

@Witiko
Copy link
Member

Witiko commented Apr 7, 2024

'./output_data/ntcir/NTCIR12-Math-Wiki-Formula/NTCIR12-MathWikiFormula-queries-prefix-participants.json.dvc' validation failed: 2 errors.

It would appear that the format of the *.dvc files has changed since dvc 0.92.0 from April 2, 2020. Then, we cannot upgrade DVC. Instead, you should try downgrading both dvc and numpy to the versions we used when we created this repo:

pip install dvc==0.92.0 numpy==1.18.2

Please, let us know if this helped to fix your issue.

how to use Python int to replace numpy.int?

In which file or files, replace the numpy.int with a Python int?

You would need to track down the module in the dvc library (or one of its dependencies) that uses the outdated method of numpy and patch it in your Python installation. Sounds too adventurous to me.

@aspnetcs
Copy link
Author

aspnetcs commented Apr 7, 2024 via email

@Witiko
Copy link
Member

Witiko commented Apr 7, 2024

/root/.local/lib/python3.8/site-packages/scipy/init.py:143: UserWarning: A NumPy version >=1.19.5 and <1.27.0 is required for this version of SciPy (detected version 1.18.2)

Then you may need to upgrade to numpy==1.19.5 using command pip install numpy==1.19.5 (or, if that leads to the numpy.int error again, look into downgrading scipy). Regardless, this seems like a warning rather than an error, so perhaps it does not needs to be solved immediately.

WARNING: assuming default target 'Dvcfile'.
ERROR: '/home/ARQMath-data-preprocessing/Dvcfile' does not exist.

We have many separate *.dvc files in the repository such as output_data/ARQMath_CLEF2020/Task2/Formula_topics_cmml_and_pmml_V2.0.tsv.dvc. Perhaps you will need to run dvc repro for each of them individually:

dvc repro output_data/ARQMath_CLEF2020/Task2/Formula_topics_cmml_and_pmml_V2.0.tsv.dvc

Furthermore, dvc 0.92.0 seems to have an -R option for processing all *.dvc files in a directory recursively:

dvc repro -R .

However, please note that the scripts require datasets that you may not have installed, citing from README.md (emphasis mine):

Producing the preprocessed datasets

To produce the preprocessed datasets yourself,

Therefore, you may want to fetch the artefacts using dvc pull and use our code only as a documentation rather than something that can be easily executed without significant modifications.

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

3 participants