{"action":"created","issue":{"url":"https://api.github.com/repos/huggingface/pytorch-pretrained-BERT/issues/78","repository_url":"https://api.github.com/repos/huggingface/pytorch-pretrained-BERT","labels_url":"https://api.github.com/repos/huggingface/pytorch-pretrained-BERT/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/huggingface/pytorch-pretrained-BERT/issues/78/comments","events_url":"https://api.github.com/repos/huggingface/pytorch-pretrained-BERT/issues/78/events","html_url":"https://github.com/huggingface/pytorch-pretrained-BERT/issues/78","id":386553265,"node_id":"MDU6SXNzdWUzODY1NTMyNjU=","number":78,"title":"TypeError: object of type 'WindowsPath' has no len()","user":{"login":"Deep1994","id":24366782,"node_id":"MDQ6VXNlcjI0MzY2Nzgy","avatar_url":"https://avatars0.githubusercontent.com/u/24366782?v=4","gravatar_id":"","url":"https://api.github.com/users/Deep1994","html_url":"https://github.com/Deep1994","followers_url":"https://api.github.com/users/Deep1994/followers","following_url":"https://api.github.com/users/Deep1994/following{/other_user}","gists_url":"https://api.github.com/users/Deep1994/gists{/gist_id}","starred_url":"https://api.github.com/users/Deep1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deep1994/subscriptions","organizations_url":"https://api.github.com/users/Deep1994/orgs","repos_url":"https://api.github.com/users/Deep1994/repos","events_url":"https://api.github.com/users/Deep1994/events{/privacy}","received_events_url":"https://api.github.com/users/Deep1994/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-02T12:03:51Z","updated_at":"2018-12-02T12:11:20Z","closed_at":null,"author_association":"NONE","body":"Hi, when I run \"tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')\", the error \"TypeError: object of type 'WindowsPath' has no len()\" occurs, what is the problem? Thank you for your excellent code!"},"comment":{"url":"https://api.github.com/repos/huggingface/pytorch-pretrained-BERT/issues/comments/443502861","html_url":"https://github.com/huggingface/pytorch-pretrained-BERT/issues/78#issuecomment-443502861","issue_url":"https://api.github.com/repos/huggingface/pytorch-pretrained-BERT/issues/78","id":443502861,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzUwMjg2MQ==","user":{"login":"Deep1994","id":24366782,"node_id":"MDQ6VXNlcjI0MzY2Nzgy","avatar_url":"https://avatars0.githubusercontent.com/u/24366782?v=4","gravatar_id":"","url":"https://api.github.com/users/Deep1994","html_url":"https://github.com/Deep1994","followers_url":"https://api.github.com/users/Deep1994/followers","following_url":"https://api.github.com/users/Deep1994/following{/other_user}","gists_url":"https://api.github.com/users/Deep1994/gists{/gist_id}","starred_url":"https://api.github.com/users/Deep1994/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deep1994/subscriptions","organizations_url":"https://api.github.com/users/Deep1994/orgs","repos_url":"https://api.github.com/users/Deep1994/repos","events_url":"https://api.github.com/users/Deep1994/events{/privacy}","received_events_url":"https://api.github.com/users/Deep1994/received_events","type":"User","site_admin":false},"created_at":"2018-12-02T12:11:20Z","updated_at":"2018-12-02T12:11:20Z","author_association":"NONE","body":"I install your PyTorch pretrained bert with pip like \"pip install pytorch-pretrained-bert\", the I run the code in Usage section like:\r\n\r\n`import torch\r\nfrom pytorch_pretrained_bert import BertTokenizer, BertModel, BertForMaskedLM\r\n\r\n# Load pre-trained model tokenizer (vocabulary)\r\ntokenizer = BertTokenizer.from_pretrained('bert-base-uncased')`\r\n\r\nbut there is an error occurs, the error infirmation is: \r\n\r\n`Traceback (most recent call last):\r\n\r\n  File \"<ipython-input-2-7725148c607d>\", line 5, in <module>\r\n    tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')\r\n\r\n  File \"C:\\Users\\Deep\\Anaconda3\\lib\\site-packages\\pytorch_pretrained_bert\\tokenization.py\", line 117, in from_pretrained\r\n    resolved_vocab_file = cached_path(vocab_file, cache_dir=cache_dir)\r\n\r\n  File \"C:\\Users\\Deep\\Anaconda3\\lib\\site-packages\\pytorch_pretrained_bert\\file_utils.py\", line 88, in cached_path\r\n    return get_from_cache(url_or_filename, cache_dir)\r\n\r\n  File \"C:\\Users\\Deep\\Anaconda3\\lib\\site-packages\\pytorch_pretrained_bert\\file_utils.py\", line 169, in get_from_cache\r\n    os.makedirs(cache_dir, exist_ok=True)\r\n\r\n  File \"C:\\Users\\Deep\\Anaconda3\\lib\\os.py\", line 226, in makedirs\r\n    head, tail = path.split(name)\r\n\r\n  File \"C:\\Users\\Deep\\Anaconda3\\lib\\ntpath.py\", line 204, in split\r\n    d, p = splitdrive(p)\r\n\r\n  File \"C:\\Users\\Deep\\Anaconda3\\lib\\ntpath.py\", line 139, in splitdrive\r\n    if len(p) >= 2:\r\n\r\nTypeError: object of type 'WindowsPath' has no len()`"}}
{"actor":{"display_login":"Deep1994"}}