Showing posts with label TuriCreate. Show all posts
Showing posts with label TuriCreate. Show all posts

No more development on Turi Create

Since I have been using Apple's machine learning framework, Turi Create in the past,
today, I went to check if there is any new development and if there is support for Julia language. 

Unfortunately, it seems like it is a NO on both counts, there is a minimal code activity since the beginning of 2020, too bad.

https://github.com/apple/turicreate/graphs/code-frequency

Please let me know in the comments if you are still using it and what for.




As an Amazon Associate I earn from qualifying purchases.

No more development on Turi Create

Since I have been using Apple's machine learning framework, Turi Create in the past,
today, I went to check if there is any new development and if there is support for Julia language. 

Unfortunately, it seems like it is a NO on both counts, there is a minimal code activity since the beginning of 2020, too bad.

https://github.com/apple/turicreate/graphs/code-frequency

Please let me know in the comments if you are still using it and what for.




As an Amazon Associate I earn from qualifying purchases.

TuriCreate: display images in Jupyter notebook instead using explore() method

When using TuriCreate in a Jupyter notebook, explore() method for images does not work very well. I created a helper method that shows me the images and their labels.


# shorthand
# sframe[3]['image'].show()

# image_testing_SFrame[0:5]['image'].explore()
sframe = image_testing_SFrame[0:5] # show first 5 records

def show_images(sframe, image_column="image", label_column="label"):
    for subset_dictionary in sframe:
        image = subset_dictionary[image_column]
        print(subset_dictionary[label_column])
        image.show()
show_images(sframe, image_column="image", label_column="label")
show_images(sframe)
 


As an Amazon Associate I earn from qualifying purchases.

TuriCreate: display images in Jupyter notebook instead using explore() method

When using TuriCreate in a Jupyter notebook, explore() method for images does not work very well. I created a helper method that shows me the images and their labels.


# shorthand
# sframe[3]['image'].show()

# image_testing_SFrame[0:5]['image'].explore()
sframe = image_testing_SFrame[0:5] # show first 5 records

def show_images(sframe, image_column="image", label_column="label"):
    for subset_dictionary in sframe:
        image = subset_dictionary[image_column]
        print(subset_dictionary[label_column])
        image.show()
show_images(sframe, image_column="image", label_column="label")
show_images(sframe)
 


As an Amazon Associate I earn from qualifying purchases.

TuriCreate: SFrame filter_by()

Create a subset SFrame by filtering a bigger SFrame




Filter using a single string


dogs_SFrame = image_training_SFrame.filter_by(values="dog", column_name="label", exclude=False) 
print(dogs_SFrame["label"][0:15]) 
['dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog']


Filter using an array of strings


animals = ["dog", "cat", "bird"] 
animals_SFrame = image_training_SFrame.filter_by(values=animals, column_name='label', exclude=False) 
print(animals_SFrame["label"][0:15]) 
['bird', 'cat', 'cat', 'dog', 'bird', 'dog', 'bird', 'bird', 'cat', 'dog', 'cat', 'bird', 'cat', 'cat', 'dog']




Example:

training_sframes = {}
for label in unique_labels:
    #print (label)
    training_sframes[label] = image_training_SFrame.filter_by(
        values = label,
        column_name = "label",
        exclude = False)
   
for key_name in training_sframes: # dictionary training_sframes
    print(key_name)






As an Amazon Associate I earn from qualifying purchases.

TuriCreate: SFrame filter_by()

Create a subset SFrame by filtering a bigger SFrame




Filter using a single string


dogs_SFrame = image_training_SFrame.filter_by(values="dog", column_name="label", exclude=False) 
print(dogs_SFrame["label"][0:15]) 
['dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog', 'dog']


Filter using an array of strings


animals = ["dog", "cat", "bird"] 
animals_SFrame = image_training_SFrame.filter_by(values=animals, column_name='label', exclude=False) 
print(animals_SFrame["label"][0:15]) 
['bird', 'cat', 'cat', 'dog', 'bird', 'dog', 'bird', 'bird', 'cat', 'dog', 'cat', 'bird', 'cat', 'cat', 'dog']




Example:

training_sframes = {}
for label in unique_labels:
    #print (label)
    training_sframes[label] = image_training_SFrame.filter_by(
        values = label,
        column_name = "label",
        exclude = False)
   
for key_name in training_sframes: # dictionary training_sframes
    print(key_name)






As an Amazon Associate I earn from qualifying purchases.

TuriCreate: Find unique records in a SFrame

Find unique records in a dataset (SFrame)




labels_column_SArray = SFrame_DataSet['label']
print(type(labels_column_SArray))
unique_labels = labels_column_SArray.unique()
print(unique_labels)
['bird', 'dog', 'cat', 'automobile']





As an Amazon Associate I earn from qualifying purchases.

TuriCreate: Find unique records in a SFrame

Find unique records in a dataset (SFrame)




labels_column_SArray = SFrame_DataSet['label']
print(type(labels_column_SArray))
unique_labels = labels_column_SArray.unique()
print(unique_labels)
['bird', 'dog', 'cat', 'automobile']





As an Amazon Associate I earn from qualifying purchases.

Re-installing Anaconda for TuriCreate environment

Recently, I run out of disk space and had to move my Anaconda to a disk with more room.

I had a bad experience with moving the anaconda3 folder, so I opted to do a full installation.

1) Download Anaconda installer


Usually, I grab the newest version 3, but truthfully, TuriCreate still uses old python-2.7.15.

https://www.anaconda.com/download/#macos

Install it in the new location following GUI screens.

2) Back up your existing conda env

If you have an environment that you want to preserve, you can save its configuration to a small yml file.

$ conda env export > environment_turi_20181105.yml

3) Delete the previous location of Anaconda


rm -r .... /anacondaX/

4) Restore the conda evn from yml file

I provided you my yml file for convenience.
conda env create -f environment_turi_20181105.yml

5) Change to that conda env




$ conda activate turi


and make sure conda env is correct:

$ conda env list
# conda environments:
#
/Users/uki/.julia/conda/3
/Users/uki/.julia/packages/ORCA/uEiWT/deps
base /anaconda2
turi * /anaconda2/envs/turi

6) Re-install Jupyter Notebook kernel


python -m ipykernel install --user --name turi --display-name "Python 2.7 (turi)"

7) Start Jupyter Notebook and test 


$ jupyter notebook






As an Amazon Associate I earn from qualifying purchases.

Re-installing Anaconda for TuriCreate environment

Recently, I run out of disk space and had to move my Anaconda to a disk with more room.

I had a bad experience with moving the anaconda3 folder, so I opted to do a full installation.

1) Download Anaconda installer


Usually, I grab the newest version 3, but truthfully, TuriCreate still uses old python-2.7.15.

https://www.anaconda.com/download/#macos

Install it in the new location following GUI screens.

2) Back up your existing conda env

If you have an environment that you want to preserve, you can save its configuration to a small yml file.

$ conda env export > environment_turi_20181105.yml

3) Delete the previous location of Anaconda


rm -r .... /anacondaX/

4) Restore the conda evn from yml file

I provided you my yml file for convenience.
conda env create -f environment_turi_20181105.yml

5) Change to that conda env




$ conda activate turi


and make sure conda env is correct:

$ conda env list
# conda environments:
#
/Users/uki/.julia/conda/3
/Users/uki/.julia/packages/ORCA/uEiWT/deps
base /anaconda2
turi * /anaconda2/envs/turi

6) Re-install Jupyter Notebook kernel


python -m ipykernel install --user --name turi --display-name "Python 2.7 (turi)"

7) Start Jupyter Notebook and test 


$ jupyter notebook






As an Amazon Associate I earn from qualifying purchases.

Installing Turi Create on Python 3.6 Anaconda Environment

Installing TuriCreate on Python 3.6 Anaconda Environment

1) Check what Python version Apple Turi Create supports



Turi Create requires:
  • Python 2.7, 3.5, 3.6

2) Switch to Python 3.6 environment

$ source activate py36



$ conda env list
# conda environments:
/Users/uki/.julia/conda/3
/Users/uki/.julia/packages/ORCA/uEiWT/deps
base /Volumes/DATA/anaconda3
py2 /Volumes/DATA/anaconda3/envs/py2
py36 * /Volumes/DATA/anaconda3/envs/py36

3) Find TuriCreate v5.1.0 package

Browse: https://anaconda.org/derickl/turicreate

$ conda install -c derickl turicreate

4) Install Jupyter Notebook kernel conda module 


$ conda install ipykernel

5) Make sure all the packages are matching and updated

$ conda update --all

6) Install Jupyter Notebook kernel with this Environment


python -m ipykernel install --user --name py36 --display-name "Python 3.6 Turi (env py36)"
Installed kernelspec py36 in /Users/uki/Library/Jupyter/kernels/py36

7) Backup your Environment

Just because things go wrong all the time.

$ conda env export > environment_py36_20181102.yml

8) Start Jupyter notebook


$ jupyter notebook



Test Turi in Jupyter Notebook


import turicreate as turi
WARNING: You are using MXNet 1.2.1 which may result in breaking behavior. To fix this, please install the currently recommended version: pip uninstall -y mxnet && pip install mxnet==1.1.0 If you want to use a CUDA GPU, then change 'mxnet' to 'mxnet-cu90' (adjust 'cu90' depending on your CUDA version):




(py36) $ pip uninstall -y mxnet && pip install mxnet==1.1.0














As an Amazon Associate I earn from qualifying purchases.

Installing Turi Create on Python 3.6 Anaconda Environment

Installing TuriCreate on Python 3.6 Anaconda Environment

1) Check what Python version Apple Turi Create supports



Turi Create requires:
  • Python 2.7, 3.5, 3.6

2) Switch to Python 3.6 environment

$ source activate py36



$ conda env list
# conda environments:
/Users/uki/.julia/conda/3
/Users/uki/.julia/packages/ORCA/uEiWT/deps
base /Volumes/DATA/anaconda3
py2 /Volumes/DATA/anaconda3/envs/py2
py36 * /Volumes/DATA/anaconda3/envs/py36

3) Find TuriCreate v5.1.0 package

Browse: https://anaconda.org/derickl/turicreate

$ conda install -c derickl turicreate

4) Install Jupyter Notebook kernel conda module 


$ conda install ipykernel

5) Make sure all the packages are matching and updated

$ conda update --all

6) Install Jupyter Notebook kernel with this Environment


python -m ipykernel install --user --name py36 --display-name "Python 3.6 Turi (env py36)"
Installed kernelspec py36 in /Users/uki/Library/Jupyter/kernels/py36

7) Backup your Environment

Just because things go wrong all the time.

$ conda env export > environment_py36_20181102.yml

8) Start Jupyter notebook


$ jupyter notebook



Test Turi in Jupyter Notebook


import turicreate as turi
WARNING: You are using MXNet 1.2.1 which may result in breaking behavior. To fix this, please install the currently recommended version: pip uninstall -y mxnet && pip install mxnet==1.1.0 If you want to use a CUDA GPU, then change 'mxnet' to 'mxnet-cu90' (adjust 'cu90' depending on your CUDA version):




(py36) $ pip uninstall -y mxnet && pip install mxnet==1.1.0














As an Amazon Associate I earn from qualifying purchases.

apt quotation..