Hello there, I have a problem on my GPC virtual machine, I can’t save any kind of learned model, even the one trained in lesson1 (pets) notebook.
The export command by the way works just fine.
Can anybody reproduce my issue, or knows what to try in order to fix this?
The error that i get is the following:
TypeError Traceback (most recent call last)
/opt/conda/lib/python3.7/site-packages/torch/serialization.py in save(obj, f, pickle_module, pickle_protocol, _use_new_zipfile_serialization)
327 with _open_file_like(f, ‘wb’) as opened_file:
–> 328 _legacy_save(obj, opened_file, pickle_module, pickle_protocol)
329
/opt/conda/lib/python3.7/site-packages/torch/serialization.py in _legacy_save(obj, f, pickle_module, pickle_protocol)
395
–> 396 pickle_module.dump(MAGIC_NUMBER, f, protocol=pickle_protocol)
397 pickle_module.dump(PROTOCOL_VERSION, f, protocol=pickle_protocol)
TypeError: file must have a ‘write’ attribute
During handling of the above exception, another exception occurred:
AttributeError Traceback (most recent call last)
in
----> 1 learn.save()
/opt/conda/lib/python3.7/site-packages/fastai/basic_train.py in save(self, file, return_path, with_opt)
252 if not with_opt: state = get_model(self.model).state_dict()
253 else: state = {‘model’: get_model(self.model).state_dict(), ‘opt’:self.opt.state_dict()}
–> 254 torch.save(state, target)
255 if return_path: return target
256
/opt/conda/lib/python3.7/site-packages/torch/serialization.py in save(obj, f, pickle_module, pickle_protocol, _use_new_zipfile_serialization)
326
327 with _open_file_like(f, ‘wb’) as opened_file:
–> 328 _legacy_save(obj, opened_file, pickle_module, pickle_protocol)
329
330
/opt/conda/lib/python3.7/site-packages/torch/serialization.py in exit(self, *args)
205 class _open_buffer_writer(_opener):
206 def exit(self, *args):
–> 207 self.file_like.flush()
208
209
AttributeError: ‘NoneType’ object has no attribute ‘flush’
output of show_install(1)
is:
=== Software ===
python : 3.7.6
fastai : 1.0.61
fastprogress : 0.2.2
torch : 1.4.0
nvidia driver : 418.87
torch cuda : 10.1 / is available
torch cudnn : 7603 / is enabled
=== Hardware ===
nvidia gpus : 1
torch devices : 1
- gpu0 : 15079MB | Tesla T4
=== Environment ===
platform : Linux-4.9.0-12-amd64-x86_64-with-debian-9.12
distro : #1 SMP Debian 4.9.210-1 (2020-01-20)
conda env : base
python : /opt/conda/bin/python
sys.path : /home/jupyter/tutorials/fastai/course-v3/nbs/dl1
/opt/conda/lib/python37.zip
/opt/conda/lib/python3.7
/opt/conda/lib/python3.7/lib-dynload
/opt/conda/lib/python3.7/site-packages
/opt/conda/lib/python3.7/site-packages/IPython/extensions
/home/jupyter/.ipython
Mon May 18 07:32:03 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.87.01 Driver Version: 418.87.01 CUDA Version: 10.1 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla T4 Off | 00000000:00:04.0 Off | 0 |
| N/A 67C P0 28W / 70W | 9785MiB / 15079MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1342 C /opt/conda/bin/python 9773MiB |
+-----------------------------------------------------------------------------+