Skip to content

Instantly share code, notes, and snippets.

View xiaofanglegoc's full-sized avatar

xiaofang wang xiaofanglegoc

View GitHub Profile
@xiaofanglegoc
xiaofanglegoc / frozen_trainning_tensorflow.py
Created January 9, 2018 15:26 — forked from ahwillia/pca_alt_min.py
Alternating Minimization in Tensorflow (PCA example)
import numpy as np
import tensorflow as tf
# N, size of matrix. R, rank of data
N = 100
R = 5
# generate data
W_true = np.random.randn(N,R)
C_true = np.random.randn(R,N)
@xiaofanglegoc
xiaofanglegoc / TC3_TD3_Q_2_1.py
Created May 23, 2017 06:35
TC3_TD3_Q_2_1.py
# TD3/serveur.py
import http.server
import socketserver
from urllib.parse import urlparse, parse_qs
# définition du handler
class RequestHandler(http.server.SimpleHTTPRequestHandler):
# ==================== Q2-1.py===========================
import http.server
import socketserver
httpd = socketserver.TCPServer(("", 8080),http.server.SimpleHTTPRequestHandler)
httpd.serve_forever()
# ==================== END ===========================
# install
## issu
1, TypeError: <method 'max' of 'numpy.ndarray' objects> is not a Python function
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:105] successfully opened CUDA library libcufft.so locally
@xiaofanglegoc
xiaofanglegoc / issue using torch
Created June 21, 2016 10:04
solution for my usage of torch
1, project: segmentation_cnn_eccv https://github.com/matt-rb/segmentation_cnn_eccv
1.1 cuDNN
/home/wang/torch/install/share/lua/5.1/trepl/init.lua:384: /home/wang/torch/install/share/lua/5.1/trepl/init.lua:384: /home/wang/torch/install/share/lua/5.1/cudnn/ffi.lua:1599: 'libcudnn (R5) not found in library path.
Please install CuDNN from https://developer.nvidia.com/cuDNN
Then make sure files named as libcudnn.so.5 or libcudnn.5.dylib are placed in your library load path (for example /usr/local/lib , or manually add a path to LD_LIBRARY_PATH)
1.1 solution:
export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH
#!/bin/sh
sudo luarocks install OPENSSL
sudo rm -rf ~/.cache/luarocks
luarocks install luacrypto OPENSSL_DIR=/usr/local/opt/openssl/
git clone https://github.com/torch/image.git
cd image
luarocks make image-1.1.alpha-0.rockspec
@xiaofanglegoc
xiaofanglegoc / installiTorch.sh
Last active June 3, 2016 09:33 — forked from jetsonhacks/installiTorch.sh
Install iTorch and prerequisites
#!/bin/sh
# Install Python prerequisites on NVIDIA Jetson TK1 for iTorch
# This is for https://github.com/facebook/iTorch
# L4T 21.3, Torch 7 (http://torch.ch)
# Python 2.7 or greater must be installed before running this script
# Torch 7 should already be installed before running this script
# iPython is loaded using pip, as repository version is 1.x version, > 2.0 is needed
# Need to compile from source as repository version libzmq3-dev is not the correct revision
wget http://download.zeromq.org/zeromq-4.0.5.tar.gz
tar xzvf zeromq-4.0.5.tar.gz
@xiaofanglegoc
xiaofanglegoc / msrc_blog.ipynb
Created December 21, 2015 15:19 — forked from amueller/msrc_blog.ipynb
ipython notebook for msrc segmentation tutorial
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.