Creating your own style transfer mirror with Gradient° and ml5.js



In this post, we will learn how to train a style transfer network with Paperspace's Gradient° and use the model in ml5.js to create an interactive style transfer mirror. This post is the second on a series of blog posts dedicated to train machine learning models in Paperspace and then use them in ml5.js. You can read the first post in this series on how to train a LSTM network to generate text here.

This is a companion discussion topic for the original entry at


Thanks for the great Tutorial, but when I start the training, the process is interrupted because of a missing file:

1 ml5.js Style Transfer Training!
2 Note: This traning will take a couple of hours.
3 Training is starting!...
4 (1, 2000, 1510, 3)
5 UID: 9
6 Training complete. For evaluation:
7    `python --checkpoint checkpoints/ ...`
8 Converting model to ml5js
9 Traceback (most recent call last):
10  File "", line 179, in <module>
11    main()
12  File "", line 175, in main
13    dump_checkpoints(kwargs['save_path'], options.model_dir)
14  File "/paperspace/", line 58, in dump_checkpoints
15    reader = tf.train.NewCheckpointReader(chk_fpath)
16  File "/usr/local/lib/python2.7/dist-    packages/tensorflow/python/", line 150, in NewCheckpointReader
17    return CheckpointReader(compat.as_bytes(filepattern), status)
18  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/", line 473, in __exit__
19    c_api.TF_GetCode(self.status.status))
20 tensorflow.python.framework.errors_impl.NotFoundError: Unsuccessful TensorSliceReader     constructor: Failed to find any matching files for checkpoints/fns.ckpt

Any ideas why that is?


Hi @manolis!

I just updated some changes to repository. The path to the COCO dataset was updated and that wasn’t been reflected in this code. If you pull the latest changes and try again it should work.

let me know how it goes


Thanks @Cris_Valenzuela
After the update it worked great!


Ran it, started fine, then got an error in node console. Spat out bad gateway and what looks like the html of the error page.

Output E:\Dropbox\Paperspace\training_styletransfer>paperspace jobs create --container
cvalenzuelab/styletransfer --machineType P5000 --command ‘./’ --project ‘S
tyle Transfer training’
Zipping directory training_styletransfer [=============] 12299440/bps 100% 0.0s
Uploading [==================] 3799971/bps 100% 0.0s
New jobId: j07a4wthzgudy
Cluster: PS Jobs
Job Pending
Waiting for job to run…


Checked Paperspace gradient under jobs, found this error:

1[FATAL tini (7)] exec ./ failed: No such file or directory



Hi - I am confused as to what the purpose of the --test image is. Does this improve / influence results? Does it matter what style of image this is in comparison to our style image? I can’t seem to find much explanation on this, even in the fast style transfer github repo.


Hey! it seems that the file is not in the directory. Can you double check that this file is your folder:


When training, the test image will be used to test the results of the model over time. It’s just a way of visualizing progress. It will not improve or influence the results.