GithubHelp home page GithubHelp logo

ohatakenji / sketchrnn-pytorch Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 3.0 30 KB

SketchRNN : a seq2seq VAE model which draws pictures

Home Page: https://arxiv.org/abs/1704.03477

Python 99.40% Dockerfile 0.60%

sketchrnn-pytorch's Introduction

sketchrnn-pytorch's People

Contributors

ohatakenji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sketchrnn-pytorch's Issues

Issue with different dataset i.e. cat.npz

Hi I was trying to run your code exactly while just changing the dataset to cat.npz that I downloaded from google cloud (https://console.cloud.google.com/storage/browser/quickdraw_dataset/full/numpy_bitmap;tab=objects?pli=1&prefix=&forceOnObjectsSortingFiltering=false).

import torch
# from dataset import To5vStrokes, V5Dataset
# from model import SketchRNN
# from trainer import Trainer
from pathlib import Path
from torch.utils.tensorboard import SummaryWriter

data_path = Path.home() / 'Desktop/Jupyter_Notebook/cat.npz'
dataset = V5Dataset(str(data_path), To5vStrokes(max_len=200), pre_scaling=True)
dataloader = torch.utils.data.DataLoader(
    dataset, batch_size=100, shuffle=True)

log_dir = Path.home() / 'Desktop/Jupyter_Notebook'
tb_writer = SummaryWriter(log_dir)

checkpoint_dir = Path.home() / 'Desktop/Jupyter_Notebook'
model = SketchRNN(enc_hidden_size=256, dec_hidden_size=512,
                  Nz=128, M=20, dropout=0.1)
trainer = Trainer(model, dataloader, tb_writer,
                  checkpoint_dir, learning_rate=0.0001)

trainer.train(epoch=300000)

tb_writer.close()

So I basically changed data_path, log_dir, and checkpoint_dir.

Then I have this error,

ValueError                                Traceback (most recent call last)
<ipython-input-14-b4a8b96ebdc7> in <module>
      7 
      8 data_path = Path.home() / 'Desktop/Jupyter_Notebook/cat.npz'
----> 9 dataset = V5Dataset(str(data_path), To5vStrokes(max_len=200), pre_scaling=True)
     10 dataloader = torch.utils.data.DataLoader(
     11     dataset, batch_size=100, shuffle=True)

<ipython-input-6-fbe5ea2c671c> in __init__(self, data_path, transform, pre_scaling)
     29         self.transform = transform
     30         self.data = np.load(data_path, encoding='bytes', allow_pickle=True)
---> 31         scale = self.scaling_factor()
     32         self.data = np.array(list(
     33             map(lambda x: self.scale_stroke(x, scale), self.data)))

<ipython-input-6-fbe5ea2c671c> in scaling_factor(self)
     42 
     43     def scaling_factor(self):
---> 44         data = np.concatenate([S for S in self.data])
     45         return np.std(data[:, 0:2])
     46 

<__array_function__ internals> in concatenate(*args, **kwargs)

ValueError: zero-dimensional arrays cannot be concatenated

Would you mind if you help me out with this please?

Number of epochs to train

Nice repository, thank you.

Could you please indicate how many epochs of training did it take to generate that apple from readme?
In the main branch test.py I see 300,000 epochs, exp1.py uses 3,000, test.py in experimental branch uses 300.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.