Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
a3magic3pocket committed Mar 9, 2023
1 parent a191c19 commit 6304139
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions my_train.py
Original file line number Diff line number Diff line change
@@ -211,16 +211,16 @@ def trainBatch(net, criterion, optimizer):
t, l = converter.encode(cpu_texts)
copied_text = utils.loadData(text, t)
copied_length = utils.loadData(length, l)
print('cpu_texts', cpu_texts)
print('len(cpu_texts)', len(cpu_texts))
print('copied_image', copied_image)
print('copied_image.shape', copied_image.shape)
print('copied_text', copied_text)
print('len(copied_text)', len(copied_text))
print('copied_length', copied_length)
print('len(copied_length)', len(copied_length))
print('TMP::len(cpu_texts)', len(cpu_texts))
print('TMP::copied_image', copied_image)
print('TMP::copied_image.shape', copied_image.shape)
print('TMP::copied_text', copied_text)
print('TMP::len(copied_text)', len(copied_text))
print('TMP::copied_length', copied_length)
print('TMP::len(copied_length)', len(copied_length))
converted = converter.decode(t, l)
print('converted', converted)
print('TMP::cpu_texts', cpu_texts)
print('TMP::converted', converted)
import sys
sys.exit(1)

1 change: 1 addition & 0 deletions utils.py
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ def encode(self, text):
elif isinstance(text, collections.Iterable):
length = [len(s) for s in text]
text = ''.join(text)
print('TMP::text', text)
text, _ = self.encode(text)
return (torch.IntTensor(text), torch.IntTensor(length))

0 comments on commit 6304139

Please sign in to comment.