TypeError: 'generator' object is not subscriptable

I run the BERT+BILSM+CRF code with pytorch,when I run the code and it came cross a error as follows:
File “/home/nlp/anaconda2/envs/Bert-BiLSTM-CRF-pytorch/lib/python3.5/site-packages/torch/nn/modules/rnn.py”, line 146, in check_forward_args check_hidden_size(hidden[0], expected_hidden_size,
TypeError: ‘generator’ object is not subscriptable
the error pytorch code is:

          if self.mode == 'LSTM':
        check_hidden_size(hidden[0], expected_hidden_size,
                          'Expected hidden[0] size {}, got {}')
        check_hidden_size(hidden[1], expected_hidden_size,
                          'Expected hidden[1] size {}, got {}')

my pytorch version is 0.4.1,how can I solve this problem?

it looks like hidden is a generator rather than a tuple of Tensors (probably from the initial state hx in the call to LSTM).
Feeding it a tuple of Tensors might work better.