Questions tagged [pytorch-ignite]

9 questions
3
votes
1 answer

Optuna Pytorch: returned value from the objective function cannot be cast to float

def autotune(trial): cfg= { 'device' : "cuda" if torch.cuda.is_available() else "cpu", # 'train_batch_size' : 64, # 'test_batch_size' : 1000, # 'n_epochs' : 1, # 'seed' : 0, # …
Tonz
  • 95
  • 8
1
vote
1 answer

Transformers summarization with Python Pytorch - how to get longer output?

I use Ai-powered summarization from https://github.com/huggingface/transformers/tree/master/examples/summarization - state of the art results. Should i train it myself to get summary output longer than used in original huggingface github training…
Vic Nicethemer
  • 1,011
  • 2
  • 14
  • 36
1
vote
1 answer

DiagonalBiLSTM RuntimeError: bool value of Tensor with more than one value is ambiguous

I am trying to implement Diagonal BiLSTM using a torch. I have CBAM model prepared, also spatial gate as mentioned in this article. My code for defining conv2d layer is as follows. def Conv2D(name, input_dim, output_dim, filter_size, inputs,…
Jayant Chauhan
  • 177
  • 1
  • 10
0
votes
0 answers

ValueError: y and y_pred must have same shape of (batch_size, num_categories, ...) and num_categories > 1

This is my code and I use pytorch-ignite. The shape of sample's labels are (batch_size,) and the outputs of my netwroy as y_pred is (batch_size,10) and 10 is the number of my class. I use criterion = F.cross_entropy as a loss function. after an…
0
votes
0 answers

Pytorch ignite metrics - passing objects

I've been playing with metrics in pytorch ignite and have come across an issue with passing ignite objects to other ignite objects, for instance this code cm = metrics.ConfusionMatrix(10) cm.reset() cm.update((y_pred,…
Dominik Ficek
  • 138
  • 11
0
votes
1 answer

Pytorch ignite create_supervised_evaluator not returning the Custom Metrics

I am trying to use create_supervised_evaluator from ignite.engine with my custom Metrics evaluator = create_supervised_evaluator(model, metrics={'perform': Perform()}, device=device) But evaluator.state.metrics.keys() is returning empty state…
0
votes
0 answers

Dataloder with IterableDataset throws exception: expected unspecified batch_sampler option

I tried to implement custom IteratableDataset with Dataloder as follows: class LazyDataset(IterableDataset): def __init__(self, file_dir): self.file_dir = file_dir self.files = os.listdir(file_dir) def __len__(self) -> int: …
Amir
  • 13,841
  • 10
  • 67
  • 104
0
votes
1 answer

Write validation metrics on pytorch-ignite ProgressBar on same line

Is there a way to write validation metrics at the end of the progress bar using pytorch-ignite like in keras? Right now, I'm using ProgressBar.log_message (example below) to print the relevant metrics, but doing so prints on a new line at the end of…
name.disp
  • 243
  • 1
  • 5
0
votes
2 answers

How can I use the LBFGS optimizer with pytorch ignite?

I started using Ignite recently and i found it very interesting. I would like to train a model using as an optimizer the LBFGS algorithm from the torch.optim module. This is my code: from ignite.engine import Events, Engine,…
Riverarodrigoa
  • 554
  • 8
  • 21