bourdakos1 / capsule-networks Goto Github PK
View Code? Open in Web Editor NEWA Tensorflow implementation of Capsule Networks
License: MIT License
A Tensorflow implementation of Capsule Networks
License: MIT License
@bourdakos1 Hi!
The usage of GPU is lower than 50% when training process.
when i run this: python main.py
, the progress is working well, but the usage of GPU is lower than 50%. How to improve the usage of GPU to save time?
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 415.27 Driver Version: 415.27 CUDA Version: 10.0 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce RTX 2070 Off | 00000000:01:00.0 On | N/A |
| 40% 52C P2 71W / 185W | 5225MiB / 7949MiB | 33% Default |
+-------------------------------+----------------------+----------------------+
I have installed tensorflow-gpu on my desktop which has two high powered NVidia gpu cards and it unfortunately is not using the gpu. I have implicitly told it to import tensorflow-gpu and it causes an error. Does anyone know how to get the main.py code to use the GPU?
Hi,
Thank you for your job.
I would use it, when a try to initialise capsNet() i found this error. Can you help me?
capsNet = CapsNet(is_training=cfg.is_training)
UnrecognizedFlagErrorTraceback (most recent call last)
<ipython-input-4-894105a67f23> in <module>()
----> 1 capsNet = CapsNet(is_training=cfg.is_training)
/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/flags.pyc in __getattr__(self, name)
82 # a flag.
83 if not wrapped.is_parsed():
---> 84 wrapped(_sys.argv)
85 return wrapped.__getattr__(name)
86
/usr/local/lib/python2.7/dist-packages/absl/flags/_flagvalues.pyc in __call__(self, argv, known_only)
630 suggestions = _helpers.get_flag_suggestions(name, list(self))
631 raise _exceptions.UnrecognizedFlagError(
--> 632 name, value, suggestions=suggestions)
633
634 self.mark_as_parsed()
UnrecognizedFlagError: Unknown command line flag 'f'
Thank you
I didnt understand why we need to tile the input in routing function? Please provide some clarity.
Ref: routing function
Hi,
I am getting an error when trying to run your code: "failed to create cublas handle: CUBLAS_STATUS_ALLOC_FAILED". I've used the GPU before, so I am not sure why I am getting this error.
My configuration : Win 10, NVIDIA GeForce 1070, CUDA 9.1, cudnn 7.0.5. I onlt have 1 GPU, so I changed your config file to only train on one gpu (flags.DEFINE_integer('num_gpu', 1, 'number of gpus for distributed training'))
In ANN and CNN, the weights are not dependent on batch_size. But here (wij and bij) it is tiled according to batch_size and that number of weights will be trained.
What if we want to input a single image and get its classification. The whole model needs to be reconstructed and retrained for that batch_size=1?
"u_hat_stopped = tf.stop_gradient(u_hat, name='stop_gradient')"
I don't think W can be updated in that case
Excellent Hacker-Noon article. Dramatic and informative! Congrats...
However, more credit (which you partially do!) should be given to the CapsNet-Tensorflow repro by Huadong Liao (aka Naturomics). His README is helpful.
Question: How does the Naturomics and your repro differ from Hinton's repro? So, it uses both Keras and TF. Why did you not use the Naturomics repro? Should mention this issue in your README.
In any case, excellent article that help me understand the significance behind capsule networks. Upgrade your README, inserting a link to your article and copying a few paragraphs at the end about how-to-use.
Hey, i am having problem intergrating this with another dataset
it includes folders as label and different images in it.
Class1/
image1.jpg
image2.jpg
Class2/
image1.jpg
image2.jpg
.
.
.
Can you help me with this issue?
from capsule.config import cfg
from capsule.utils import load_mnist
from capsule.capsNet import CapsNet
import os
import tensorflow as tf
from tqdm import tqdm
return :
ModuleNotFoundError Traceback (most recent call last)
/content/capsule/capsNet.py in ()
7 import tensorflow as tf
8
----> 9 from config import cfg
10 from utils import get_batch_data
11 from capsLayer import CapsLayer
ModuleNotFoundError: No module named 'config'
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.