deep-learning

Deep learnin on Google Colab: loading large image dataset is very long, how to accelerate the process?

前提是你 提交于 2020-02-03 01:51:05
问题 I'm working on a Deep Learning model using Keras and to speed up the computation I'd like to use the GPU available on google colab. My image files are already loaded on my google drive. I have 24'000 images for training on 4'000 for testing my model. However when I load my images into an array, it takes a very long time (almost 2h) So it is not very convenient to do that every time I use google colab notebook. Would you know how to accelerate the process ? This is my current code: TRAIN_DIR =

This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical

狂风中的少年 提交于 2020-02-02 14:47:25
问题 I ma trying to install tensorflow on Ubuntu and I am getting this message : (base) k@k-1005:~/Documents/ClassificationTexte/src$ python tester.py Using TensorFlow backend. RUN: 1 1.1. Training the classifier... LABELS: {'negative', 'neutral', 'positive'} 2019-12-10 11:58:13.428875: I tensorflow/core/platform/cpu_feature_guard.cc:145] This TensorFlow binary is optimized with Intel(R) MKL-DNN to use the following CPU instructions in performance critical operations: SSE4.1 SSE4.2 AVX AVX2 FMA To

Implement transfer learning on niftynet

纵饮孤独 提交于 2020-02-02 13:13:10
问题 I want to implement transfer learning using the Dense V-Net architecture. As I was searching on how to do this, I found that this feature is currently being worked on (How do I implement transfer learning in NiftyNet?). Although from that answer it is quite clear that there is not a straight way to implement it, I was trying to: 1) Create the Dense V-Net 2) Restore weigths from the .ckpt file 3) Implement transfer learning on my own To perform step 1, I thought I could use the niftynet

Implement transfer learning on niftynet

拜拜、爱过 提交于 2020-02-02 13:10:14
问题 I want to implement transfer learning using the Dense V-Net architecture. As I was searching on how to do this, I found that this feature is currently being worked on (How do I implement transfer learning in NiftyNet?). Although from that answer it is quite clear that there is not a straight way to implement it, I was trying to: 1) Create the Dense V-Net 2) Restore weigths from the .ckpt file 3) Implement transfer learning on my own To perform step 1, I thought I could use the niftynet

Visualizing ConvNet filters using my own fine-tuned network resulting in a “NoneType” when running: K.gradients(loss, model.input)[0]

試著忘記壹切 提交于 2020-02-02 06:55:25
问题 I have a fine-tuned network that I created which uses vgg16 as it's base. I am following section 5.4.2 Visualizing CovNet Filters in Deep Learning With Python (which is very similar to the guide on the Keras blog to visualize convnet filters here). The guide simply uses the vgg16 network. My fine tuned model uses the vgg16 model as the base, for example: model.summary() Layer (type) Output Shape Param # ======================================================================= vgg16 (Model)

Visualizing ConvNet filters using my own fine-tuned network resulting in a “NoneType” when running: K.gradients(loss, model.input)[0]

这一生的挚爱 提交于 2020-02-02 06:55:13
问题 I have a fine-tuned network that I created which uses vgg16 as it's base. I am following section 5.4.2 Visualizing CovNet Filters in Deep Learning With Python (which is very similar to the guide on the Keras blog to visualize convnet filters here). The guide simply uses the vgg16 network. My fine tuned model uses the vgg16 model as the base, for example: model.summary() Layer (type) Output Shape Param # ======================================================================= vgg16 (Model)

Visualizing ConvNet filters using my own fine-tuned network resulting in a “NoneType” when running: K.gradients(loss, model.input)[0]

孤街醉人 提交于 2020-02-02 06:54:31
问题 I have a fine-tuned network that I created which uses vgg16 as it's base. I am following section 5.4.2 Visualizing CovNet Filters in Deep Learning With Python (which is very similar to the guide on the Keras blog to visualize convnet filters here). The guide simply uses the vgg16 network. My fine tuned model uses the vgg16 model as the base, for example: model.summary() Layer (type) Output Shape Param # ======================================================================= vgg16 (Model)

shuffle in the model.fit of keras

China☆狼群 提交于 2020-02-02 02:22:53
问题 In the model.fit of keras , there is a shuffle parameter, shuffle: Boolean (whether to shuffle the training data before each epoch) or str (for 'batch'). 'batch' is a special option for dealing with the limitations of HDF5 data; it shuffles in batch-sized chunks. Has no effect when steps_per_epoch is not None. Assume the training set is a list with 50000 elements, so the whole list will be randomly permuted before each epoch? Of if the batch size is 250 , only the elements belonging to each

PyTorch custom loss function

浪子不回头ぞ 提交于 2020-02-02 00:27:16
问题 How should a custom loss function be implemented ? Using below code is causing error : import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms import numpy as np import matplotlib.pyplot as plt import torch.utils.data as data_utils import torch.nn as nn import torch.nn.functional as F num_epochs = 20 x1 = np.array([0,0]) x2 = np.array([0,1]) x3 = np.array([1,0]) x4 = np.array([1,1]) num_epochs = 200 class cus2(torch.nn.Module): def __init__(self):

Keras custom RMSLE metric

我怕爱的太早我们不能终老 提交于 2020-02-01 17:23:13
问题 How do I implement this metric in Keras? My code below gives the wrong result! Note that I'm undoing a previous log(x + 1) transformation via exp(x) - 1, also negative predictions are clipped to 0: def rmsle_cust(y_true, y_pred): first_log = K.clip(K.exp(y_pred) - 1.0, 0, None) second_log = K.clip(K.exp(y_true) - 1.0, 0, None) return K.sqrt(K.mean(K.square(K.log(first_log + 1.) - K.log(second_log + 1.)), axis=-1) For comparison, here's the standard numpy implementation: def rmsle_cust_py(y, y