Skip to content

Instantly share code, notes, and snippets.

View ryubidragonfire's full-sized avatar

Dragon ryubidragonfire

View GitHub Profile
openapi: 3.0.1
info:
title: PizzaShopAPI
version: '1.0'
paths:
/Pizza:
get:
tags:
- Pizza
responses:

Create a .whl file

python setup.py sdist bdist_wheel

Read Write

To write a dataframe to csv with specific date_format,

df.to_csv("data.csv", date_format='%Y-%m-%d %H:%M:%S', index=False)

To read from csv to a dataframe,

df = pd.read_csv("data.csv", parse_dates=['datetime_col'])

Update an environment with .yml

conda env update --name myenv --file envname.yml

Remove an environment

conda remove --name your_env_name --all

Create a new environment from .yml

conda env create --file envname.yml

Export an environment to .yml

x2go

sudo apt-get update

sudo add-apt-repository ppa:x2go/stable

sudo apt-get install x2goserver x2goserver-xsession

xfce

sudo apt-get install xubuntu-desktop

Add environment to Jupyter Notebook:

python -m ipykernel install --user --name envname --display-name "env name you want to display"

Display output of all variables:

from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"

Set KERAS_BACKEND

KERAS_BACKEND=tensorflow python deepRanking.py

ISSUES

CUDA Error: out of memory

./darknet detector train /home/cyyam/git/darknet/build/darknet/x64/data/car_hellicopter/obj.data /home/cyyam/git/darknet/build/darknet/x64/data/car_hellicopter/yolov3-obj.cfg /home/cyyam/git/darknet/build/darknet/x64/weights/darknet53.conv.74
yolov3-obj
layer     filters    size              input                output
    0 conv     32  3 x 3 / 1   416 x 416 x   3   ->   416 x 416 x  32
    1 conv     64  3 x 3 / 2   416 x 416 x  32   ->   208 x 208 x  64
    2 conv     32  1 x 1 / 1   208 x 208 x  64   ->   208 x 208 x  32
 3 CUDA Error: out of memory