Open VeNuS122225 opened 4 years ago
When I ran the analysis.py file, my pycharm reported an error
(torch) C:\Users\Administrator\Desktop\Exemplar-VAE-master_2\Exemplar-VAE-master>python analysis.py --dir pretrained_model --classify Namespace(KNN=False, batch_size=100, classification_dir='classification_report', classify=True, count_active_dimensions=False, cyclic_generation=False, dir='pretrained_model', epochs=100, g enerate=False, grid_interpolation=False, hidden_units=1024, hyper_lambda=0.4, input_size=[1, 28, 28], just_log_likelihood=False, lr=0.1, save_model_path='', seed=1, training_set_size=50000, tsne_visualization=False) filename** 1 MODEL NAME vae constructor he initializer data stats: 50000 50000 10000 10000 10000 10000 train size 50000 val size 10000 test size 10000 prior variance -2.418909788131714 epoch number: 1 Traceback (most recent call last): File "analysis.py", line 210, in args.classification_dir, args, model) File "C:\Users\Administrator\Desktop\Exemplar-VAE-master_2\Exemplar-VAE-master\utils\classify_data.py", line 114, in classify_data loss2 = compute_loss(classifier(data_augment), label_augment, args) File "C:\Users\Administrator\Desktop\Exemplar-VAE-master_2\Exemplar-VAE-master\utils\classify_data.py", line 57, in compute_loss one_hot_label[torch.arange(args.batch_size), label] += (1 - held_out_percent) IndexError: tensors used as indices must be long, byte or bool tensors
I run this code in Win 7 64bit
When I ran the analysis.py file, my pycharm reported an error
(torch) C:\Users\Administrator\Desktop\Exemplar-VAE-master_2\Exemplar-VAE-master>python analysis.py --dir pretrained_model --classify Namespace(KNN=False, batch_size=100, classification_dir='classification_report', classify=True, count_active_dimensions=False, cyclic_generation=False, dir='pretrained_model', epochs=100, g enerate=False, grid_interpolation=False, hidden_units=1024, hyper_lambda=0.4, input_size=[1, 28, 28], just_log_likelihood=False, lr=0.1, save_model_path='', seed=1, training_set_size=50000, tsne_visualization=False) filename** 1 MODEL NAME vae constructor he initializer data stats: 50000 50000 10000 10000 10000 10000 train size 50000 val size 10000 test size 10000 prior variance -2.418909788131714 epoch number: 1 Traceback (most recent call last): File "analysis.py", line 210, in
args.classification_dir, args, model)
File "C:\Users\Administrator\Desktop\Exemplar-VAE-master_2\Exemplar-VAE-master\utils\classify_data.py", line 114, in classify_data
loss2 = compute_loss(classifier(data_augment), label_augment, args)
File "C:\Users\Administrator\Desktop\Exemplar-VAE-master_2\Exemplar-VAE-master\utils\classify_data.py", line 57, in compute_loss
one_hot_label[torch.arange(args.batch_size), label] += (1 - held_out_percent)
IndexError: tensors used as indices must be long, byte or bool tensors