Skip to content

Instantly share code, notes, and snippets.

View harusametime's full-sized avatar
:octocat:
Loving Sake and coding

Masaki Samejima harusametime

:octocat:
Loving Sake and coding
View GitHub Profile
@harusametime
harusametime / paddleocr.ipynb
Created May 3, 2021 08:00
PaddleOCRを SageMaker にデプロイする
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import boto3
redshift = boto3.client('redshift')
credentials = redshift.get_cluster_credentials(
DbUser='demouser',
DbName='dev',
ClusterIdentifier='redshiftml',
DurationSeconds=3600,
AutoCreate=False
)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import os
import argparse
import tensorflow as tf
# global variables
width = 28
height = 28
n_class = 10
# tfrecord parser
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@harusametime
harusametime / fujixerox_printer_ubuntu.md
Created January 5, 2018 10:58
How to install Fujixerox printer in ubuntu 16.04

What

This is how to install Fujixerox C5000-d printer in ubuntu 16.04. Unfotunately, the official printer driver is too old to be compatibe with latest ubuntu.

Step

  1. Download "fxlinuxprint_1.1.0+ds.orig.tar.xz" in Launchpad[https://launchpad.net/ubuntu/+source/fxlinuxprint/1.1.0+ds-2]
  2. Extract the tar.xz file.
tar Jxfv fxlinuxprint_1.1.0+ds.orig.tar.xz
  1. Search and run "Printer" from "Dash" that is the top icon in launcher
@harusametime
harusametime / joblib_on_docker.md
Last active February 11, 2022 20:18
Note on joblib with docker

Problem

When passing big arrays to joblib.Parallel in docker container, parallel processing does not start immediately.

Why?

Joblib uses the folder specified by "JOBLIB_TEMP_FOLDER" for memmap of the arrays. Without specifying, JOBLIB_TEMP_FOLDER is set to /dev/shm, which usually has small size and is not enough for the big arrays.

https://pythonhosted.org/joblib/generated/joblib.Parallel.html

Solution

  • Set JOBLIB_TEMP_FOLDER