Giter Site home page Giter Site logo

ai_writer's Introduction

Overview

This code will generate a story based on an image that you input. More information can be found in the original repo. This the code for 'Build an AI Writer' on Youtube

We were barely able to catch the breeze at the beach , and it felt as if someone stepped out of my mind . She was in love with him for the first time in months , so she had no intention of escaping . The sun had risen from the ocean , making her feel more alive than normal . She 's beautiful , but the truth is that I do n't know what to do . The sun was just starting to fade away , leaving people scattered around the Atlantic Ocean . I d seen the men in his life , who guided me at the beach once more.

Samim has made an awesome blog post with lots of results here.

Dependencies

For running on your CPU, you will need to install Caffe and its python interface.

Use pip to install any missing dependencies

Basic Usage

Simply create a new python file in this repo or run this code from the python command line

import generate
z = generate.load_all()
generate.story(z, './images/ex1.jpg')

Sample output:

I let the woman in her eyes , and I had no idea what to say to her . It was a small group of people , both of them . As soon as the taxi arrived , he gave me a hug . It was the first time I 'd spent so much time in New York . In fact , it was almost as if he were going to be the only man in his life , and he made a mental note to pin her down on either side of her body . She loved those men , a little less than ten minutes and I am stunned by someone . - See more at: http://www.somatic.io/examples/4wDNbDm0#sthash.TvSDmyRU.dpuf

Credits

Credit for the vast majority of code here goes to Ryan Kiros. I've merely created a wrapper around some of the important functions to get people started.

ai_writer's People

Contributors

llsourcell avatar testbounty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ai_writer's Issues

Problem with config.py file

It looks like generate.py and config.py files are the same . I dont know if this is purposely same or most probably by mistake because there is no attribute FLAG_CPU_MODE and paths in config.py

import generate - module not found

Hi my console starts with this when running python:


Python 3.6.0 |Anaconda 4.3.1 (x86_64)| (default, Dec 23 2016, 13:19:00) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>  import generate
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'generate'
>>> 

I did all installation dependencies. Where can I locate the generate module to install for.

No module named theano

I'm giving this project a 3third try. Even installed ubuntu on my Imac for this.

After installing all dependencies and adjusting the config.py file (except for two lines I don't know what to place in)
# Skip-thoughts paths['skmodels'] = '/u/rkiros/public_html/models/' paths['sktables'] = '/u/rkiros/public_html/models/'
But that's not the problem for now, I get a import theano error. Even though i've installed it via conda.
`---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in ()
----> 1 import generate

/home/quinten/Documents/neuralstory/neural-storyteller-master/generate.py in ()
8 import skimage.transform
9
---> 10 import skipthoughts
11 import decoder
12 import embedding

/home/quinten/Documents/neuralstory/neural-storyteller-master/skipthoughts.py in ()
4 import os
5
----> 6 import theano
7 import theano.tensor as tensor
8

ImportError: No module named theano
`
conda list theano gives = theano 0.9.0 py27_0

any help would be appriciated!

downsample module has been moved to the theano.tensor.signal.pool module. "downsample module has been moved to the theano.tensor.signal.pool module.")

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/theano/tensor/signal/downsample.py:6: UserWarning: downsample module has been moved to the theano.tensor.signal.pool module. "downsample module has been moved to the theano.tensor.signal.pool module.") Traceback (most recent call last): File "/Users/vincenzofornaro/PycharmProjects/machine/run.py", line 1, in <module> import generate File "/Users/vincenzofornaro/PycharmProjects/machine/generate.py", line 14, in <module> import config File "/Users/vincenzofornaro/PycharmProjects/machine/config.py", line 21, in <module> if not config.FLAG_CPU_MODE: AttributeError: 'module' object has no attribute 'FLAG_CPU_MODE'

I have this error when I start the .py

AttributeError

WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.

Warning (from warnings module): File "D:\Python\Python27\lib\site-packages\theano\tensor\signal\downsample.py", line 6 "downsample module has been moved to the theano.tensor.signal.pool module.") UserWarning: downsample module has been moved to the theano.tensor.signal.pool module.

Traceback (most recent call last): File "C:\Users\chatRG\Desktop\AI_Writer\generate.py", line 21, in <module> if not config.FLAG_CPU_MODE: AttributeError: 'module' object has no attribute 'FLAG_CPU_MODE'

ImportError: cannot import name downsample

Getting this error when trying to run this code. Any ideas on how to fix?

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-5-5af402f414c9> in <module>()
----> 1 import generate
      2 z = generate.load_all()
      3 generate.story(z, './images/ex1.jpg')

/home/user/Documents/GitHub/AI_Writer/generate.py in <module>()
     12 import embedding
     13 
---> 14 import config
     15 
     16 import lasagne

/home/user/Documents/GitHub/AI_Writer/config.py in <module>()
     14 import config
     15 
---> 16 import lasagne
     17 from lasagne.layers import InputLayer, DenseLayer, NonlinearityLayer, DropoutLayer
     18 from lasagne.layers import MaxPool2DLayer as PoolLayer

/home/user/anaconda3/envs/magenta27/lib/python2.7/site-packages/lasagne/__init__.py in <module>()
     17 from . import nonlinearities
     18 from . import init
---> 19 from . import layers
     20 from . import objectives
     21 from . import random

/home/user/anaconda3/envs/magenta27/lib/python2.7/site-packages/lasagne/layers/__init__.py in <module>()
      5 from .noise import *
      6 from .conv import *
----> 7 from .pool import *
      8 from .shape import *
      9 from .merge import *

/home/user/anaconda3/envs/magenta27/lib/python2.7/site-packages/lasagne/layers/pool.py in <module>()
      4 from ..utils import as_tuple
      5 
----> 6 from theano.tensor.signal import downsample
      7 
      8 

ImportError: cannot import name downsample

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.