Where-are-they-looking-PyTorch icon indicating copy to clipboard operation
Where-are-they-looking-PyTorch copied to clipboard

Implementation of best = 1000000000 . How it relates to euclid_mindist?

Open BhuvaneshwariBhaskaran opened this issue 6 years ago • 5 comments

I was trying to train a model but getting an error for euclid_mindist line 114 in utils.py.

I used epocs 40 and reduced the train.mat file to 5000 images.

Error: Bool value of Tensor with more than one value is ambiguous

`for i in range(l):

    best = 1000000000
    
    predy = ((output[i] / 227.0) / 227.0) 
    predx = ((output[i] % 227.0) / 227.0) 

    ct = 0
    for j in range(100):
        ground_x = target[i][2*j]
        ground_y = target[i][2*j + 1]
        if ground_x == -1 or ground_y == -1:
            break

        temp = np.sqrt(np.power((ground_x - predx), 2) + np.power((ground_y - predy), 2))

        if temp < best:
            best = temp
        ct += 1

    fulltotal += best

fulltotal = fulltotal / float(l * 1.0)
return fulltotal`

It would be great if you can give me a brief of about implementation of this logic with best = 1000000000.

BhuvaneshwariBhaskaran avatar Aug 15 '19 18:08 BhuvaneshwariBhaskaran

I was trying to train a model but getting an error for euclid_mindist line 114 in utils.py.

I used epocs 40 and reduced the train.mat file to 5000 images.

Error: Bool value of Tensor with more than one value is ambiguous

`for i in range(l):

    best = 1000000000
    
    predy = ((output[i] / 227.0) / 227.0) 
    predx = ((output[i] % 227.0) / 227.0) 

    ct = 0
    for j in range(100):
        ground_x = target[i][2*j]
        ground_y = target[i][2*j + 1]
        if ground_x == -1 or ground_y == -1:
            break

        temp = np.sqrt(np.power((ground_x - predx), 2) + np.power((ground_y - predy), 2))

        if temp < best:
            best = temp
        ct += 1

    fulltotal += best

fulltotal = fulltotal / float(l * 1.0)
return fulltotal`

It would be great if you can give me a brief of about implementation of this logic with best = 1000000000.

I also face this error. May I ask you how you dealt with the error finally please?

robert1015 avatar Nov 14 '19 02:11 robert1015

Facing the same issue Error: Bool value of Tensor with more than one value is ambiguous . Can someone help?

prathmeshrmadhu avatar Feb 27 '20 15:02 prathmeshrmadhu

I also facing the same issue.Can someone help?

zrSKY98 avatar Mar 29 '20 06:03 zrSKY98

Facing the same issue Error: Bool value of Tensor with more than one value is ambiguous . Can someone help?

May I ask you how you dealt with the error please?

zrSKY98 avatar Mar 29 '20 08:03 zrSKY98

@zrSKY98 @prathmeshrmadhu @robert1015 I tried to solve this problem, I modified the return value of the predict() in models / gazennet.py ==> return hm_base.view (-1, 227 * 227)

le-wei avatar May 07 '20 08:05 le-wei