Search code examples
luatorchluajit

How to download a dataset to arbitrary location in Torch?


How can I download a dataset to arbitrary location. For example:

require "dp"
local datasource = dp.BillionWords{context_size=5, train_file="train_tiny.th7"}

Attempts to download the dataset into ~/ while I need it to be downloaded to /media/removable/SD.

How can I do it in Torch?


Solution

  • Ok, I figured it out by reading init.lua for dp package. In order to force Torch download data to some custom location before running your script do:

    $ export TORCH_DATA_PATH="/my/new/location"