본문 바로가기

Coding/Machine Learning

(4)
Example : Multiprocessing with shared large numpy array in Jupyter, Windows 10 In mmd.py: def pool_init(image_base, image_shape): global image image = np.ctypeslib.as_array(image_base.get_obj()) image = image.reshape(*image_shape) def pool_job(row_number): image[row_number, :] = row_number In notebook: import numpy as np from mmd import pool_init, pool_job from multiprocessing import Array, cpu_count, Pool, freeze_support if __name__ == "__main__": freeze_support() image =..
An example of custom loss using model internals - Tensorflow version : 2.4.0 rc1 - Colab notebook: colab.research.google.com/drive/1Hwi6auz2meKvD0ogdDSywb2E4_J1F9S_?usp=sharing import tensorflow as tf from tensorflow import keras • Create a custom layer calculating and adding custom loss: class ReconLoss(keras.layers.Layer): def __init__(self, **kwargs): super().__init__(**kwargs) def call(self, inputs): x, reconstruction = inputs recon_loss ..
Implementation of Guided Grad-CAM with Tensorflow 2 Full example : github.com/Crispy13/crispy/blob/master/examples/guided_grad_cam.ipynb Crispy13/crispy Contribute to Crispy13/crispy development by creating an account on GitHub. github.com def make_gradcam_heatmap( img_array, model, last_conv_layer_name, classifier_layer_names ): """ Makes grad cam heatmap. Parameters ---------- img_array : an input image model : a keras model object last_conv_la..
It seems that RTX 3080 has a issue with CUDA 10.1 * 영작 연습 및 정보 기록용으로 올린 포스팅입니다. I bought GIGABYTE RTX 3080 gaming oc 10GB for deep learning and used it to train a model. But the validation loss was nan but training loss was fine. I tested the same script with 4 environments(OS : Windows 10 x64): 1. 3700x + RTX 3080 (CUDA 10.1) 2. 3700x only (no GPU) 3. Other laptop (i7 8750H + GTX 1050ti) 4. 3700x + RTX 3080 (CUDA 11.0 + cudnn 8.0.3) The valida..