Issue 1:
🐛 Bug

2020-02-12 01:34:22,801 copying C:\Users\1025289\AppData\Local\Temp\2\tmp5d0w7nip to cache at C:\Users\1025289.flair\models\en-pos-ontonotes-fast-v0.4.pt

2020-02-12 01:34:22,973 removing temp file C:\Users\1025289\AppData\Local\Temp\2\tmp5d0w7nip

2020-02-12 01:34:22,988 loading file C:\Users\1025289.flair\models\en-pos-ontonotes-fast-v0.4.pt

Traceback (most recent call last):

File "fmain.py", line 16, in

main()

File "fmain.py", line 4, in main

intent_obj = GET_INTENT()

File "C:\Users\1025289\Desktop\intent\get_intent.py", line 10, in init

super().init(b_preprocess_query=b_preprocess_query)

File "C:\Users\1025289\Desktop\intent\model_flair.py", line 24, in init

self._load_flair_model(flair_model)

File "C:\Users\1025289\Desktop\intent\model_flair.py", line 30, in _load_flair_model

self._seq_tag = SequenceTagger.load(flair_model)

File "C:\Users\1025289\AppData\Local\Programs\Python\Python38\lib\site-packages\flair\nn.py", line 86, in load

state = torch.load(f, map_location=flair.device)

File "C:\Users\1025289\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 529, in load

return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)

File "C:\Users\1025289\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\serialization.py", line 692, in _legacy_load

magic_number = pickle_module.load(f, **pickle_load_args)

TypeError: file must have 'read', 'readinto' and 'readline' attributes

To Reproduce

Environment

PyTorch Version (e.g., 1.0):1.4

OS (e.g., Linux): Windows 10

How you installed PyTorch (conda, pip, source):pip

Python version: 3.81 x64

CUDA/cuDNN version: No

GPU models and configuration:No

Any other relevant information:

Issue 2:
🐛 Bug

Error text:

======================================================================
ERROR: test_serialization_filelike_api_requirements (__main__.TestTorch)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_torch.py", line 4446, in test_serialization_filelike_api_requirements
_ = torch.load(filemock)
File "C:\Users\circleci\project\build\win_tmp\build\torch\serialization.py", line 590, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\circleci\project\build\win_tmp\build\torch\serialization.py", line 754, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
TypeError: file must have 'read', 'readinto' and 'readline' attributes

======================================================================
ERROR: test_serialization_filelike_missing_attrs (__main__.TestTorch)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_torch.py", line 4473, in test_serialization_filelike_missing_attrs
self._test_serialization_filelike(to_serialize, mock, desc)
File "test_torch.py", line 4458, in _test_serialization_filelike
b = torch.load(data)
File "C:\Users\circleci\project\build\win_tmp\build\torch\serialization.py", line 590, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\circleci\project\build\win_tmp\build\torch\serialization.py", line 754, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
TypeError: file must have 'read', 'readinto' and 'readline' attributes

======================================================================
ERROR: test_serialization_filelike_stress (__main__.TestTorch)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_torch.py", line 4479, in test_serialization_filelike_stress
self._test_serialization_filelike(a, lambda x: FilelikeMock(x, has_readinto=False),
File "test_torch.py", line 4458, in _test_serialization_filelike
b = torch.load(data)
File "C:\Users\circleci\project\build\win_tmp\build\torch\serialization.py", line 590, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "C:\Users\circleci\project\build\win_tmp\build\torch\serialization.py", line 754, in _legacy_load
magic_number = pickle_module.load(f, **pickle_load_args)
TypeError: file must have 'read', 'readinto' and 'readline' attributes

----------------------------------------------------------------------
Ran 3620 tests in 103.071s

To Reproduce

Steps to reproduce the behavior:

python test_torch.py

Expected behavior

Environment

Please copy and paste the output from our

environment collection script

(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py

PyTorch Version (e.g., 1.0): e4db0a5

OS (e.g., Linux): Windows

How you installed PyTorch (conda, pip, source): source

Build command you used (if compiling from source): python setup.py build

Python version: 3.8

CUDA/cuDNN version: N/A

GPU models and configuration: N/A

Any other relevant information:

Additional context

cc @ezyang @gchanan @zou3519 @peterjc123 @suo