Posts

Showing posts with the label deep-learning

How to build a Language model using LSTM that assigns probability of occurence for a given sentence

How to build a Language model using LSTM that assigns probability of occurence for a given sentence Currently, I am using Trigram to do this. It assigns the probability of occurrence for a given sentence. But Its limited to the only context of 2 words. But LSTM's can do more. So how to build an LSTM Model that assigns the probability of occurrence for a given sentence? This question has not received enough attention. (TensorFlow Implementation)[tensorflow.org/versions/master/tutorials/… Can some body provide keras implementation? – Shashi Tunga yesterday 1 Answer 1 I have just coded a very simple example showing how one might compute the probability of occurrence of a sentence with a LSTM model. The full code can be found here. Suppose we want to pre...

Resize images and merge data sets in python

Resize images and merge data sets in python I have two datasets, images1 and images2(generated in the function below, by reading images in a loop via given path) def measure(images1,path): images2= for filename in glob.glob(path): #looking for pngs temp = cv2.imread(filename).astype(float) images2.append (augm_img) print(np.array(images2).dtype) print(np.array(images).dtype) print(np.array(images2).shape) print(np.array(images).shape) Prints outputs: float64 float64 (1, 24, 24, 3) (60000, 32, 32, 3) (2, 24, 24, 3) (60000, 32, 32, 3) (3, 24, 24, 3) (60000, 32, 32, 3) (4, 24, 24, 3) (60000, 32, 32, 3) .... .... etc After reading images from path i want to resize images2 read from file to same size as images (:,32,32,3) (:,32,32,3) And merge these two datasets in one (via concatenate or append?) in order to train my model. Until now i cant find a way to do this so any advice would be helpful. ...

ResourceExhaustedError With CNN

ResourceExhaustedError With CNN I am trying to complete this tutorial with this source code I have tried using their large images data as well as my own small data set of 52 images (46x46) but I keep running into ResourceExhaustedError ResourceExhaustedError OOM when allocating tensor with shape[1016064,1024] Is there any way I can edit this code so it trains on smaller training sets so I dont run into this error? I have tried changing batch sizes in the code but this accomplished nothing. I also made sure I dont have any previous tensorflow projects running (i restarted my computer) my label.txt contains these two lines: cat dog and my train and validation folders contain 2 subfolders with the same name that contain the images. I am using: GeForce GTX 850M major: 5 minor: 0 memoryClockRate(GHz): 0.9015 totalMemory: 4.00GiB freeMemory: 3.35GiB before I hit the error I get this print out: Limit: 3235767910 InUse: 223232 MaxInUse: ...

How to make the openpose use caffe without cuda supported

How to make the openpose use caffe without cuda supported I wan to try Openpose: https://github.com/CMU-Perceptual-Computing-Lab/openpose in my laptop with an AMD video card,so no cuda is possible, is that possiable?How? 4 Answers 4 Running caffe with non-NVIDIA card requires opencl branch. Integrating that branch with the caffe branch used by OpenPose might be tricky (and might be straight forward - I haven't tried it myself). If you want to "play it safe", you can disable ALL GPU support by setting OpenPose CPU_ONLY := 1 In your Makefile.config before compiling caffe. This way you'll have a CPU version that does not require any CUDA/NVIDIA support. Makefile.config I would add to Shai's answer that you need to disable # USE_CUDNN := 1 sometime when its left on,the setup function of layers do some CUDA ASSERT checking that fails and prevent the program to continue There is...