Skip to content

ValueError: translation table must be 256 characters long #1

Description

@livc
➜  captionGen git:(master) ✗ python main.py
using pretrained cnn resnet50
Downloading: "https://s3.amazonaws.com/pytorch/models/resnet50-19c8e357.pth" to /Users/zhao/.torch/models/resnet50-19c8e357.pth
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 102502400/102502400 [02:10<00:00, 782741.06it/s]
loading annotations into memory...
Done (t=1.76s)
creating index...
index created!
Traceback (most recent call last):
  File "main.py", line 185, in <module>
    main()
  File "main.py", line 89, in main
    vocab = build_vocab()
  File "/Users/zhao/Desktop/Dropbox/repo/captionGen/data.py", line 46, in build_vocab
    captions = simple_tokenize([ann['caption'] for ann in anns])
  File "/Users/zhao/Desktop/Dropbox/repo/captionGen/data.py", line 33, in simple_tokenize
    string.punctuation).strip().split()
ValueError: translation table must be 256 characters long

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions