Skip to content

Commit

Permalink
Merge pull request #5 from sjtubblythe/dev
Browse files Browse the repository at this point in the history
fix issue when run in GPU environment
  • Loading branch information
zhoubolei authored May 6, 2019
2 parents bb2d35f + fd5a997 commit 2163454
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions feature_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def feature_extraction(self, model=None, memmap=True):
input = input.cuda()
input_var = V(input,volatile=True)
logit = model.forward(input_var)
while np.isnan(logit.data.max()):
while np.isnan(logit.data.cpu().max()):
print("nan") #which I have no idea why it will happen
del features_blobs[:]
logit = model.forward(input_var)
Expand Down Expand Up @@ -263,4 +263,3 @@ def tally(self, features, threshold, savepath=''):
for i in range(len(ordering)):
writer.writerow(rets[i])
return rets

0 comments on commit 2163454

Please sign in to comment.