kesara / deepdreamer Goto Github PK
View Code? Open in Web Editor NEWEasy to configure Python program that make use of Google's DeepDream.
Home Page: https://deepdreamer.fq.nz/
License: GNU General Public License v3.0
Easy to configure Python program that make use of Google's DeepDream.
Home Page: https://deepdreamer.fq.nz/
License: GNU General Public License v3.0
This could be a bash script, which checks for required 3rd party requirements and try to install them if they are not present.
Hi @kesara,
I pulled your changes and now when I try to run python deepdreamer.py [IMG]
I get this error:
deepdreamer.py: error: one of the arguments image --list-layers is required
I don't know much about argument parsing, but is there a way to set a default?
This could be a bash script, which checks for required 3rd party requirements and try to install them if they are not present.
Using the gif argument now returns "Error: only integer scalar arrays can be converted to a scalar index"
This might be something to do with how Numpy is handling np.float32 now.
When I run it using the bvlc_googlenet (sha5: 405fc5acd08a3bb12de8ee5e23a96bec22f08204), I get the following:
Traceback (most recent call last):
File "deepdreamer.py", line 110, in <module>
main()
File "deepdreamer.py", line 105, in main
raise e
File "deepdreamer.py", line 102, in main
duration=args.duration, loop=loop, gpu=gpu, gpuid=args.gpuid)
File "/home/rick/projects/meredith_animal_dreams/deepdreamer/deepdreamer/deepdreamer.py", line 180, in deepdream
octave_scale=octave_scale, end=end, clip=clip)
File "/home/rick/projects/meredith_animal_dreams/deepdreamer/deepdreamer/deepdreamer.py", line 104, in _deepdream
_make_step(net, end=end, clip=clip, **step_params)
File "/home/rick/projects/meredith_animal_dreams/deepdreamer/deepdreamer/deepdreamer.py", line 57, in _make_step
dst = net.blobs[end]
KeyError: 'inception_4c/output
This same issue arose when trying to use Google's original notebook, so I think perhaps it is an issue with the bvlc_googlenet
file.
Two flags, one which prints out which layer is being worked on (right now it only prints out which dream iteration). The other which saves the output of every individual layer during a dream.
Issue I have gotten but cant figure out how to get around.. I did pip install images2gif
gateway@gateway-evil:~/work/deepdreamer$ python2.7 deepdreamer.py --gif true image.jpg
Traceback (most recent call last):
File "deepdreamer.py", line 9, in <module>
from deepdreamer.deepdreamer import deepdream, deepdream_video, list_layers
File "/home/gateway/work/deepdreamer/deepdreamer/deepdreamer.py", line 12, in <module>
from deepdreamer.images2gif import writeGif
ImportError: No module named images2gif
Wanted to make sure I had the module.
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>>
>>> import sys
>>>
>>>
>>>
>>> reqs = subprocess.check_output([sys.executable, '-m', 'pip', 'freeze'])
>>>
>>> installed_packages = [r.decode().split('==')[0] for r in reqs.split()]
>>>
>>> print(installed_packages)
[u'adium-theme-ubuntu', u'backports.functools-lru-cache', u'backports.shutil-get-terminal-size', u'cycler', u'Cython', u'decorator', u'dnspython', u'enum34', u'gyp', u'h5py', u'images2gif', u'images2gif-Pillow', u'ipython', u'ipython-genutils', u'kiwisolver', u'leveldb', u'matplotlib', u'networkx', u'nose', u'numpy', u'pandas', u'pathlib2', u'pexpect', u'pickleshare', u'Pillow', u'prompt-toolkit', u'protobuf', u'ptyprocess', u'pycrypto', u'pycurl', u'Pygments', u'pyparsing', u'Pyste', u'python-apt', u'python-dateutil', u'python-gflags', u'pytz', u'PyYAML', u'scandir', u'scikit-image', u'scipy', u'simplegeneric', u'six', u'subprocess32', u'traitlets', u'unity-lens-photos', u'wcwidth']
>>>
notice u'images2gif is listed.
any suggestions?
Hey @kesara there's a pretty sweet project at samim23/DeepDreamAnim which wouldn't be hard to merge into this project. What do you think?
Create set of unit tests for deepdreamer.
user@user-VirtualBox:~/deepdream$ python deepdreamer.py winter_1024.jpg --octaves 9 --itern 20 --layers inception_5b/3x3 --network bvlc_googlenet
Error: Could not open file deploy.prototxt
user@user-VirtualBox:~/deepdream$ python deepdreamer.py winter_1024.jpg --octaves 9 --itern 20 --layers inception_5b/3x3
Error: Could not open file deploy.prototxt
How do I fix this?
So I trained a Googlenet model and now I am trying to run your code with my model.
But I get this error:
ImportError: No module named _caffe
or
ImportError: No module named caffe
Even on a VM where I had your project working previously, I still get this error. Nothing seems to fix it. I'm literally going crazy because nothing seems to fix this error, which also exists on everything I try.
I get the following error when running:
[libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 7:15: Message type "caffe.LayerParameter" has no field named "input_param".
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0502 18:42:02.591785 20844 upgrade_proto.cpp:928] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: deploy.prototxt
*** Check failure stack trace: ***
I added force_backward: true
to deploy.prototxt but to no avail. Any ideas?
just replace
from caffe import Classifier
with
import caffe
and
net = Classifier
with
net = caffe.Classifier
and add
caffe.set_mode_gpu()
caffe.set_device(0)
before
img_pool = [img_path,]
to start using GPU 0
I guess we can use something like NSIS (Nullsoft Scriptable Install System) to checks for required 3rd party requirements and try to install them if they are not present.
Current master raises this error when I execute this command:
$ python3 deepdreamer.py --gpuid 0 --gif true deepdreamer/demo1.jpg
...
Dream 97 saved.
Dream 98 saved.
Dream 99 saved.
Creating gif...
Error: only integer scalar arrays can be converted to a scalar index
The images are generated fine.
Hi I'm getting this error after installing all dependencies:
File "deepdreamer.py", line 11, in
from caffe import Classifier, set_device, set_mode_gpu
ImportError: cannot import name 'Classifier'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.