Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tensorlayer/iterate.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ def minibatches(inputs=None, targets=None, batch_size=None, shuffle=False):
excerpt = indices[start_idx:start_idx + batch_size]
else:
excerpt = slice(start_idx, start_idx + batch_size)
yield inputs[excerpt], targets[excerpt]
if (isinstance(inputs, list) or isinstance(targets, list)) and (shuffle == True):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does it still work if isinstance(inputs, list) == True but isinstance(targets, list) == False?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, it doesn't, list can't be indexed by a list of ID.

Copy link
Member

@luomai luomai Apr 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputs = [inputs[i] for i in excerpt] if isinstance(inputs, list) else inputs[excerpt]
targets = [targets[i] for i in excerpt] if isinstance(targets, list)) else targets[excerpt]
yield inputs, targets

yield [inputs[i] for i in excerpt], [targets[i] for i in excerpt] # zsdonghao: for list indexing when shuffle==True
else:
yield inputs[excerpt], targets[excerpt]


def seq_minibatches(inputs, targets, batch_size, seq_length, stride=1):
Expand Down
2 changes: 1 addition & 1 deletion tensorlayer/models/mobilenetv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class MobileNetV1(Layer):
>>> # restore pre-trained parameters
>>> cnn.restore_params(sess)
>>> # train your own classifier (only update the last layer)
>>> train_params = tl.layers.get_variables_with_name('output')
>>> train_params = tl.layers.get_variables_with_name('out')

Reuse model

Expand Down
2 changes: 1 addition & 1 deletion tensorlayer/models/vgg16.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def restore_params(self, sess):


class VGG16(VGG16Base):
"""Pre-trained VGG-16 Model.
"""Pre-trained VGG-16 model.

Parameters
------------
Expand Down