Thanks to visit codestin.com
Credit goes to github.com

Skip to content

.item #28

@LotusWhu

Description

@LotusWhu

{'trade_off': 1.0, 'name': 'JAN'}
Traceback (most recent call last):
File "train.py", line 288, in
transfer_classification(config)
File "train.py", line 222, in transfer_classification
print image_classification_test(dset_loaders["target"], nn.Sequential(base_network, bottleneck_layer, classifier_layer), test_10crop=prep_dict["target"]["test_10crop"], gpu=use_gpu)
File "train.py", line 107, in image_classification_test
accuracy = torch.sum(torch.squeeze(predict).float() == all_label).item() / float(all_label.size()[0])
AttributeError: 'int' object has no attribute 'item'

when I remove the .item(), it works well, just wondering anyone meet the similar issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions