Skip to content

Instantly share code, notes, and snippets.

View huyhoang17's full-sized avatar
🎯
Focusing

Phan Hoang huyhoang17

🎯
Focusing
View GitHub Profile
@chilin0525
chilin0525 / test.ipynb
Last active May 19, 2023 06:32
EfficientNet-PyTorch to ONNX
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
from __future__ import print_function
import argparse
import numpy as np
import time
tt = time.time()
import cv2
from grpc.beta import implementations
@matheustguimaraes
matheustguimaraes / install-cuda-cudnn.md
Last active March 20, 2023 05:08
Install CUDA 10.0 and cuDNN v7.4.2 on Ubuntu 16.04

Install CUDA 10.0 and cuDNN v7.4.2 on Ubuntu 16.04

Install the latest NVIDIA driver

Update package lists, download and install NVIDIA driver

sudo apt-get update
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt install nvidia-410
@himanshurawlani
himanshurawlani / export_saved_model.py
Created October 19, 2018 21:54
Script to convert Keras models to TensorFlow Serving SavedModel format
import tensorflow as tf
# The export path contains the name and the version of the model
tf.keras.backend.set_learning_phase(0) # Ignore dropout at inference
model = tf.keras.models.load_model('./inception.h5')
export_path = '../my_image_classifier/1'
# Fetch the Keras session and save the model
# The signature definition is defined by the input and output tensors
# And stored with the default serving key
@zeyademam
zeyademam / Troubleshoot-dcnn.md
Last active January 22, 2024 05:54
Troubleshooting Convolutional Neural Nets

Troubleshooting Convolutional Neural Networks

Intro

This is a list of hacks gathered primarily from prior experiences as well as online sources (most notably Stanford's CS231n course notes) on how to troubleshoot the performance of a convolutional neural network . We will focus mainly on supervised learning using deep neural networks. While this guide assumes the user is coding in Python3.6 using tensorflow (TF), it can still be helpful as a language agnostic guide.

Suppose we are given a convolutional neural network to train and evaluate and assume the evaluation results are worse than expected. The following are steps to troubleshoot and potentially improve performance. The first section corresponds to must-do's and generally good practices before you start troubleshooting. Every subsequent section header corresponds to a problem and the section is devoted to solving it. The sections are ordered to reflect "more common" issues first and under each header the "most-eas

@Mahedi-61
Mahedi-61 / cuda_11.8_installation_on_Ubuntu_22.04
Last active May 4, 2024 14:18
Instructions for CUDA v11.8 and cuDNN 8.9.7 installation on Ubuntu 22.04 for PyTorch 2.1.2
#!/bin/bash
### steps ####
# Verify the system has a cuda-capable gpu
# Download and install the nvidia cuda toolkit and cudnn
# Setup environmental variables
# Verify the installation
###
### to verify your gpu is cuda enable check
@DylanModesitt
DylanModesitt / layers.py
Created March 8, 2018 14:28
Attentive LSTM keras
from keras import backend as K
from keras import regularizers, constraints, initializers, activations
from keras.layers.recurrent import RNN, Layer, _generate_dropout_mask, _generate_dropout_ones
from keras.engine import InputSpec
from keras.legacy import interfaces
import warnings
# Copied from original keras source
def _time_distributed_dense(x, w, b=None, dropout=None,
# -*- coding: utf-8 -*-
"""
Created on Fri May 05 04:12:36 2017
@author: ADubey4
"""
from __future__ import unicode_literals, print_function
import gensim
from gensim.parsing import PorterStemmer
@kylemcdonald
kylemcdonald / Triplet Loss.ipynb
Last active November 29, 2022 20:42
Experimenting with triplet loss embeddings.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mixxorz
mixxorz / services.py
Last active January 21, 2020 16:52
Django Service Objects
from django import forms
from django.core.exceptions import ValidationError
from django.db import transaction
class InvalidInputsError(Exception):
def __init__(self, errors, non_field_errors):
self.errors = errors
self.non_field_errors = non_field_errors