Skip to content

ValueError: array must not contain infs or NaNs #2

@TianheWu

Description

@TianheWu

Using GPU 2
number of train scenes: 160
number of test scenes: 40
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1875/1875 [06:53<00:00, 4.54it/s]
Traceback (most recent call last):
File "/home/wth/IQT/train.py", line 156, in
loss, rho_s, rho_p = train_epoch(config, epoch, model_transformer, model_backbone, save_output, criterion, optimizer, scheduler, train_loader)
File "/home/wth/IQT/trainer.py", line 87, in train_epoch
rho_p, _ = pearsonr(np.squeeze(pred_epoch), np.squeeze(labels_epoch))
File "/home/wth/anaconda3/envs/wthEnv/lib/python3.9/site-packages/scipy/stats/stats.py", line 4045, in pearsonr
normxm = linalg.norm(xm)
File "/home/wth/anaconda3/envs/wthEnv/lib/python3.9/site-packages/scipy/linalg/misc.py", line 145, in norm
a = np.asarray_chkfinite(a)
File "/home/wth/anaconda3/envs/wthEnv/lib/python3.9/site-packages/numpy/lib/function_base.py", line 488, in asarray_chkfinite
raise ValueError(
ValueError: array must not contain infs or NaNs

I using scipy 1.7.2. I don't know how to solve this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions