Hi,
I am getting error when I am trying to train the model.
Below is the error.
Traceback (most recent call last):
File "D:/Projects/ML/DeepL/NLPLSTM/lstm/lst.py", line 234, in
nextBatch, nextBatchLabels = getTrainBatch()
File "D:/Projects/ML/DeepL/NLPLSTM/lstm/lst.py", line 170, in getTrainBatch
arr[i] = ids[num-1:num]
ValueError: could not broadcast input array from shape (0,250) into shape (250)
Code:
def getTrainBatch():
labels = []
arr = np.zeros([batchSize, maxSeqLength])
for i in range(batchSize):
if i % 2 == 0:
num = randint(1,11499)
labels.append([1,0])
else:
num = randint(13499,24999)
labels.append([0,1])
arr[i] = ids[num-1:num]
return arr, labels
Hi,
I am getting error when I am trying to train the model.
Below is the error.
Traceback (most recent call last):
File "D:/Projects/ML/DeepL/NLPLSTM/lstm/lst.py", line 234, in
nextBatch, nextBatchLabels = getTrainBatch()
File "D:/Projects/ML/DeepL/NLPLSTM/lstm/lst.py", line 170, in getTrainBatch
arr[i] = ids[num-1:num]
ValueError: could not broadcast input array from shape (0,250) into shape (250)
Code:
def getTrainBatch():
labels = []
arr = np.zeros([batchSize, maxSeqLength])
for i in range(batchSize):
if i % 2 == 0:
num = randint(1,11499)
labels.append([1,0])
else:
num = randint(13499,24999)
labels.append([0,1])
arr[i] = ids[num-1:num]
return arr, labels