Open loretoparisi opened 7 years ago
Example of session with GPU
Using the GPU the performances will speed up of 3x at least during the generation. Please run with ./run.sh GPU
root@b26bc09607fa:/sentiment# nvidia-smi
Fri Apr 21 18:13:49 2017
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.57 Driver Version: 367.57 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GRID K520 Off | 0000:00:03.0 Off | N/A |
| N/A 38C P8 17W / 125W | 0MiB / 4036MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
+-----------------------------------------------------------------------------+
root@b26bc09607fa:/sentiment# python
.git/ Dockerfile.gpu README.md encoder.py run.sh test_sentiment.py
Dockerfile LICENSE build.sh model/ test_generative.py utils.py
root@b26bc09607fa:/sentiment# python test_generative.py
2017-04-21 18:14:03.451601: I tensorflow/core/common_runtime/gpu/gpu_device.cc:887] Found device 0 with properties:
name: GRID K520
major: 3 minor: 0 memoryClockRate (GHz) 0.797
pciBusID 0000:00:03.0
Total memory: 3.94GiB
Free memory: 3.91GiB
2017-04-21 18:14:03.451662: I tensorflow/core/common_runtime/gpu/gpu_device.cc:908] DMA: 0
2017-04-21 18:14:03.451697: I tensorflow/core/common_runtime/gpu/gpu_device.cc:918] 0: Y
2017-04-21 18:14:03.451731: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GRID K520, pci bus id: 0000:00:03.0)
'I couldn't figure out'... --> (argmax sampling):
Positive sentiment (1 sentence):
I couldn't figure out how to use the stand and the stand but I love it and it is so easy to use.
Negative sentiment (+100 chars):
I couldn't figure out how to get the product to work and the company would not even try to resolve the problem. I would ...
'I couldn't figure out'... --> (weighted samples after each word):
Positive sentiment (3 examples, 2 sentences each):
(0) I couldn't figure out the controls and controls on the Roku box. I have used Netflix and the controls are easy to use.
(1) I couldn't figure out what to do and I was glad I found this book. The book is clear and easy to follow.
(2) I couldn't figure out how to use it properly but it is easy to make my coffee and use it all the time. I would buy another soon.
Negative sentiment (3 examples, 2 sentences each):
(0) I couldn't figure out how to use this because it is so hard to set up the first time. Not even the worst thing that was ever to be done to me.
(1) I couldn't figure out how to contact the vendor who is in India and sending the product back to company. What good is it when you get it mailed back to someone that finds it really useful? I am returning this item and looking for a different product.
(2) I couldn't figure out the problem like the rest of the product was good enough to send back but not worth any return and I feel wasted of money.
I have had this thing for exactly 3 weeks and it is still locked up on a different window and still not connected.
'I couldn't figure out'... --> (weighted samples after each character):
Sentiment not influenced (3 sentences):
I couldn't figure out how to separate the usb points but it's fine now.Thankfully Amazon.com was able to deal with the error.
Sentiment fixed to 0 (3 sentences):
I couldn't figure out the plot, but even with that the story still fell flat and silly of Jamie, no offense to J Weller.
was thinking it would be low in calories but its really good. didnt actually try it though when i tried just a small amount.
Sligthly negative sentiment (3 sentences):
I couldn't figure out what it was supposed to do. I have Comcast. I wanted to do the site fast so they would see my device.
Thanks! I found this very helpful. Hope the Docker file can get merged? Looking like for current code to work, it needs a very specific TF version...
Oh such a perfect day. 0.741055 I'd like to share it with you. 0.109342 You just keep me hanging on. You just keep me hanging on! 0.999466
I did noticed that calls to transform
need to be of no larger than a batch of 64.
@moscow25 I will send a PR!
@loretoparisi Thanks a tonne. Very Helpful ..!!
@loretoparisi Thanks a bunch!
You're welcome!
I have here added a Docker file for both CPU and GPU builds.
How To Build the Docker image
To build the Docker image for CPU only
or execute
./build.sh
while to build the Docker image for GPU
or you execute
./build.sh GPU
How To Run the Docker image
To run for CPU
or execute
./run.sh
while to run for GPU you have to attach the nvidia-docker driver and device (here we attach the device 0, that is the first GPU as default):
or execute
./run.sh GPU
How To Use it
As soon as you run the image you will be in the
/sentiment
folder. Then you can run the provided examplestest_sentiment.py
:and the
test_generative.py
example, adapted from this fork.Notes
generate_sequence
method.nvidia-docker
installed. To check the nvidia toolkit installation please run thenvidia-smi
command to list the available connected gpu.tensorflow
latest python3 docker image -tensorflow:latest-py3
andtensorflow:latest-gpu-py3
for the gpu.tqdm
module via pip in the Dockerfile.If there will be further info how to train this model, I will add to the Docker image.