Archive for the ‘MacOS’ Category

Install TensorFlow using Anaconda

July 17, 2017 Leave a comment

If you search online, there will be so many posts on how to install TensorFlow on mac, some are older ones, some are new, hard to decide which one to follow. Let’s just make the flow easier so we can focus on the core part to explore the deep learning.

Please note that starting v1.2 TensorFlow no longer support GPU on mac-os, so in the followings, we will just install the CPU version. It’s good to start with something simple. There are two ways of install it under Anaconda.

Use ‘conda’ command which can be quite straight forward.

# Python 2.7
$ conda create -n tensorflow python=2.7

$ source activate tensorflow
(tensorflow)$  # Your prompt should change

# Use 'conda' command: Linux/Mac OS X, Python 2.7/3.4/3.5, CPU only:
(tensorflow)$ conda install -c conda-forge tensorflow

Screen Shot 2017-07-17 at 4.26.00 PM

or use the pip command

(tensorflow)$ pip install --ignore-installed --upgrade \



You can follow up to install keras and ipython within the env:

# note this will downgrade tensor flow to 1.0

conda install -c conda-forge keras=2.0.2

conda install ipython


Categories: Deep learning, MacOS

4 Steps to Change X-code Project Version

May 14, 2013 Leave a comment

After updating your projects, you may want to give it a new version number. Here are four steps of how to change it:

Step 0: Click the target — you can see your current version name (Opencv Tutorial)





Step 1: (slowly)Double Click the name(in blue), you will be able to change the name (Opencv Tutorial1.1)




Step 2: Now add a new scheme






Step 3: X-code should already automatically detect the changes, so simply click OK. You are done Now:)



Categories: MacOS, Objective-C

Config mex for Matlab on macOS

July 7, 2012 Leave a comment

I have been trying a lot to make the ‘mex’ working on my mac. But a lot of errors such as can’t find the ‘float.h’, although it is there! multiple tries… finally fix this problem today 🙂

I searched a little bit and finally found this link is quite useful. Basically, you have to make some changes of the ‘’ file. I have Matlab 2012a, and x-code 4 installed. I didn’t try the suggestion of downloading Xcode3, but the following suggestions work. Find the block of ;; maci64, and change MACOSX_DEPLOYMENT_TARGET to ‘10.6’. Also remove -isysroot in CFLAGS and CXXFLAGS (there are two -isysroot).  Here’s my final file.

 CFLAGS="-fno-common -no-cpp-precomp -arch $ARCHS -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" 
 CFLAGS="$CFLAGS -fexceptions"
 CLIBS="$CLIBS -lstdc++"
 CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch $ARCHS -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" 
 CXXLIBS="$MLIBS -lstdc++"



Categories: MacOS, Matlab

How to map drive through MAC to PC

June 6, 2012 Leave a comment

This is what I found recently, which is very useful.


1. In the Finder, click on the Go menu, selectConnect to Server.

2. Enter the address to where the resource is you wish to map.

i.e.   smb://

or if you have the ip address:

i.e.    smb://

3. Enter your network password when prompted.

4. A new icon should appear on the desktop. That is your mapped network drive.

Categories: MacOS

Fix UIActionSheet Cancel Button

May 22, 2012 Leave a comment

I found that using the UIActionSheet, it seems that the “Cancel” button does not function well. It turns out to be a normal problem, where here gives the right answer. I followed the instruction and changed the code (self — is the


[self.actionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table)


[self.actionSheet showInView:self.parentViewController.tabBarController.view];

Categories: MacOS, Objective-C, Programming

ios Image Proc

May 22, 2012 Leave a comment

Well opencv is a good thing, but sometimes really hard to do the configuration. Depends on your purposed, if just for simple image processing, there are actually several example codes where you can learn from .

1) GLImageprocessing by Apple




Categories: MacOS, Objective-C

Opencv Test on Xcode

April 19, 2012 1 comment

I pre-installed opencv (2.3.1) for python binding, but haven’t tried it out in Xcode. Here’s what I found that works on my Mac. I am using Xcode4.3, Mac Lion 10.7.3.

Just to clarify, I almost followed this link, which turns out working well for the example code.

– Make a new project and choose “Command Line Tool”, choose C++ as the type for the project. Xcode will automatically generate a main.cpp for you.

– Go to project setting, select all, among which search the “Header search path”, and add “/opt/local/include”

– Create a folder for your ‘framework’ on the left panel,  let’s say, name it as “opencv-Frameworks”, and right click it use “Add files to..”. You will going to add three files which are located at </opt/local/lib>. They are: libopencv_ml.2.3.1.dylib, libopencv_highgui.2.3.1.dylib, libopencv_core.2.3.1.dylib

– You don’t have to copy those items, but just an option 🙂

– Now, copy the demo code in the above link to your main.cpp, click build+run, you should see a pop up window like this:

– You can find a completed working project here.

Categories: MacOS, OpenCV Tags: ,