question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"RuntimeError: Could not infer dtype of numpy.int64" occurs on some models

See original GitHub issue

Hi there, I encountered RuntimeError: Could not infer dtype of numpy.int64 during running some models provided by this repository. (Some report RuntimeError: Numpy is not available.) The command I used is python run.py [MODEL] -d cuda -m eager -t eval/train. I think I have installed the correct environment (including numpy) and most of the models in the repository work well. So I am wondering what’s going on with these problematic models.

The questioned models are fastNLP_Bert, detectron2_maskrcnn, yolov3(train), Super_SloMo, vision_maskrcnn, etc.

Thanks so much for any feedback.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Lin-Maocommented, Oct 31, 2022

Hi @xuzhao9, I solved this issue by downgrading the pillow@9.2.0 to pillow@8.2.0. For reference to those who encounter the same issue.

1reaction
Lin-Maocommented, Sep 17, 2022

Hi @xuzhao9, I was originally using AppCases/pytorch but now I am using https://github.com/pytorch/pytorch/commit/6162a043640cf01695cf568edd0be047d56477ff. It still has the same error. I am also using the latest vision and torchtext.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fit failing with RuntimeError: Could not infer dtype of numpy ...
int64. Context: I want to run a classification model on complaints text using fastai.
Read more >
RuntimeError: Could not infer dtype of numpy.int64 - nlp
I have a line of code: label_tensor = torch.tensor(self.label [item]).long () when I train on Google colab, it's not wrong, but when I...
Read more >
Could not infer dtype of numpy.int64 - Questions
I have my own dataset I created using the introductory tutorial. But when I try to use it in my model, I get...
Read more >
RuntimeError: Could not infer dtype of NoneType · Issue #3932
a model fails to reproduce the results in detectron2 model zoo, or proves existence of bugs. Environment: Paste the output of the following ......
Read more >
PyTorch: Infer dtype from device capability, not input data
In your case, as numpy has it's default set to np.float64 (regardless of system and architecture) PyTorch will infer it's analogous ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found