Just trying to train a model using the fast neural style example. Using Python 3.6.5 in Windows 10 - it gives me  a OSError: [Errno 22] Invalid argument after the model training has gone through all the different epochs and it needs to write a file in the save-model-dir …
The command I use:
C:\Users\M Khoury\Documents\programming\deep_learning\examples-master\fast_neural_style>python neural_style/neural_style.py train --dataset training0/ --style-image images/style-images/mosaic.jpg --save-model-dir mod --epochs 2 --cuda 1
The error stack gives me :
Traceback (most recent call last):
File “neural_style/neural_style.py”, line 239, in 
main()
File “neural_style/neural_style.py”, line 233, in main
train(args)
File “neural_style/neural_style.py”, line 116, in train
torch.save(transformer.state_dict(), save_model_path)
File “C:\Miniconda3\lib\site-packages\torch\serialization.py”, line 161, in save
return _with_file_like(f, “wb”, lambda f: _save(obj, f, pickle_module, pickle_protocol))
File “C:\Miniconda3\lib\site-packages\torch\serialization.py”, line 116, in _with_file_like
f = open(f, mode)
OSError: [Errno 22] Invalid argument: ‘mod\epoch_2_Sat_May_12_16:39:39_2018_100000.0_10000000000.0.model’
Update - windows does not like the model file to have some characters like \ or possibly the colon : …
If I substitute the code in neurostyle.py at line 116:
save_model_path = os.path.join(args.save_model_dir, save_model_filename)
by:
save_model_path = os.path.join(args.save_model_dir, ‘last-model.model’)
then the code works …