MNIST dataset with Bayesian Network python - python

I have a research about soccer result prediction using bayesian network. But, I just a beginner on it. Then I want to start study about BN (Bayesian Network) with MNIST dataset, because my soccer dataset is just similar with MNIST, or I can say my dataset imitate the MNIST. I follow tutorial from this website https://alpha-i.co/blog/MNIST-for-ML-beginners-The-Bayesian-Way.html and I try it. But I can't get the result because there is out of memory output. I train the model from tutorial in CPU with Intel(R) Core(TM) i7-6700K CPU # 4.00GHz, NVIDIA graphic with OpenGL renderer: GeForce GTX 1060 3GB/PCIe/SSE2, and RAM 32.132,6 MB. Actually, I don't quite understand with the tutorial. I had tried ANN (Artificial Neural Network) using tensorflow with 500 data before I tried the BN and I got the result of ANN. But, why I can't get the BN result? Does BN need more memory space to run? Can I get other BN tutorials with MNIST??

Related

Keras model taking too long to train

So I have the following model for sentiment analysis (using pre trained word embeddings):
And as visible, I have a pre trained embedding matrix and only about 500k trainable parameters. So why does it take a whole eternity to train this model? The batch size is 128 and number of epochs is 25. And the ETA for first epoch is about 10 minutes. I haven't even completed that.
Just to mention, I am not using CUDA or anything. I don't think I have a GPU enabled Tensorflow. And I'm willing to do anything to increase the speed. And I have Tensorflow 2.1.0.
And here's the answer I am not using CUDA or anything. Training on CPU is much slower than on GPU. If you don't have high-performance enough video card, you can use several services such as Google Colab or Kaggle

How one can quickly verify that a CNN actually learns?

I tried to build a CNN from scratch based on LeNet architecture from this article
I implemented backdrop and now trying to train it on the MNIST dataset using SGD with 16 batch size. I want to find a quick way to verify that the learning goes well and there are no bugs. For this, I visualize loss for every 100th batch but it takes too long on my laptop and I don't see an overall dynamic (the loss fluctuates downwards, but occasionally jumps up back so I am not sure). Could anyone suggest a proven way to find that the CNN works well without waiting many hours of training?
The MNIST consist of 60k datasets of 28 * 28 pixel.Training a CNN with batch size 16 will have 4000 forward pass per epochs.
Now taking into consideration that your are using LeNet which not a very deep model.
I would suggest you to do followings:
Check your PC specifications such as RAM,Processor,GPU etc.
Try your to train your model on cloud service such Google Colab, Kaggle and others
Try a batch size of 128 or 64
Try to normalize your image data set before training
Training speed also depends on machine learning framework you are using such as Tensorflow, Pytorch etc.
I hope this will help.

fairseq toolkit not using GPU to train NMT model

I am training an English-Vietnamese NMT model using fairseq.
fairseq tells that it is training the model on 1 GPU. However, when I check the GPU, It seems not to be used and the training process is very slow.
screenshot: GPU usage
Training on 63k sentences corpus: an epoch takes about 1 hours. (model: fconv)
Training on 233k sentences corpus: an epoch takes about 4 hours. (model: transformer)
screenshot: console log
My GPU is NVIDIA GeForce GTX 1050 and the CUDA version is 10.2.
Am I successfully training the model on GPU?
Glad to see your solutions/suggestions.

How can I make deep learning model training more faster on GPU?

I have tried to train VGG16 model using Tensorflow 2.0 for imagenet data on Titan RTX GPU (24G memory ).
But, estimated training time is about 52 days.(Batch size is 128, for 300 epochs)
Is it normal situation? I think it is so strange.
And, could I know there is some way to accelerate training my model?
This gist is my all code. Thank you.

Error training images using tensorflow inception v3

I am implementing image classification using TensorFlow Inception v3 with GTX 1060 GPU. I trained around 3000 images in 9 different classifier, where each classifier contains from 100 to 500 images(100*100 px) using tensor for poets.
But when I have images more than 500, it throws out error and training fails. Same class with less images trains without error. My Image data size for each class is around 5000~10000 but only I can train data size of around 300~400. more of the data and it gives out following GPU error.
The specification as follows:
Windows 7 with GeForce GTX 1060
Anaconda 3 with python 3.5
Tensorflow Inception V3
I am novice for Tensorflow but I had faced the same problem.
My suggestion would be:
Try to rename all the images like:
TrainImage001.jpg
TrainImage002.jpg
TrainImage003.jpg
and try converting your images to jpg.
Still I am not sure but at least give it a try.. :)

Categories

Resources