This code was tested with python 3.7, however, it should work with any python 3.
python3 -m venv venv
source venv/bin/activate
python3 -m pip install -r requirements.txt
Download data from Kaggle and unzip it. The easiest way is to use kaggle console API. To setup it, follow this guide. However, you can download the data using your browser - results will be the same.
After that, execute the following commands:
kaggle datasets download alessiocorrado99/animals10
mkdir -p data
cd data
unzip ../animals10.zip
cd ..
python3 tsne.py
Additional options:
python3 tsne.py -h
usage: tsne.py [-h] [--path PATH] [--batch BATCH] [--num_images NUM_IMAGES]
optional arguments:
-h, --help show this help message and exit
--path PATH
--batch BATCH
--num_images NUM_IMAGES
You can change the data directory with --path
argument.
Tweak the --num_images
to speed-up the process - by default it is 500, you can make it smaller.
Tweak the --batch
to better utilize your PC's resources. The script uses GPU automatically if it available. You may
want to increase the batch size to utilize the GPU better or decrease it if the default batch size does not fit your
GPU.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。