IMPORTANT: If you are new to Bittensor, we recommend familiarizing yourself with the basics on the Bittensor Website before proceeding.
Ensure you are running Subtensor locally to minimize outages and improve performance. See Run a Subtensor Node Locally.
Be aware of the minimum compute requirements for our subnet, detailed in Minimum compute YAML configuration. A GPU is recommended for training, but not required for inference while running a miner.
Download the repository and navigate to the folder:
git clone https://github.com/natixnetwork/natix-subnet.git && cd natix-subnetWe recommend using a Poetry environment with Python 3.11 to manage dependencies:
curl -sSL https://install.python-poetry.org | python3 -
poetry env use 3.11
poetry installThis will install all necessary dependencies and prepare your environment.
Only required for training -- deployed miner instances do not need access to these datasets.
Optionally, pre-download the training datasets by running:
poetry run python base_miner/datasets/download_data.pyThe default list of datasets and their download location is defined in base_miner/config.py.
To mine on our subnet, you must have a registered hotkey and have submitted at least one model.
To reduce the risk of deregistration due to technical issues or poor model performance, we recommend the following:
- Test your miner on testnet before mining on mainnet.
- Before registering your hotkey on mainnet, verify that your port is open:
curl your_ip:your_portbtcli s register --netuid 72 --wallet.name [wallet_name] --wallet.hotkey [wallet.hotkey] --subtensor.network finneybtcli s register --netuid 323 --wallet.name [wallet_name] --wallet.hotkey [wallet.hotkey] --subtensor.network testRun ./setup_env.sh to generate a miner.env file with default configuration.
Make sure to update your miner.env file with your wallet name, hotkey, miner port, and model configuration.
# following are initial values
IMAGE_DETECTOR=ViT
IMAGE_DETECTOR_CONFIG=ViT_roadwork.yaml
VIDEO_DETECTOR=TALL
VIDEO_DETECTOR_CONFIG=tall.yaml
# Device Settings
IMAGE_DETECTOR_DEVICE=cpu # Options: cpu, cuda
VIDEO_DETECTOR_DEVICE=cpu
NETUID=323 # 323 for testnet, 72 for mainnet
SUBTENSOR_NETWORK=test # Networks: finney, test, local
SUBTENSOR_CHAIN_ENDPOINT=wss://test.finney.opentensor.ai:443
# Endpoints:
# - wss://entrypoint-finney.opentensor.ai:443
# - wss://test.finney.opentensor.ai:443/
# Wallet Configuration
WALLET_NAME=
WALLET_HOTKEY=
# Miner Settings
MINER_AXON_PORT=8091
BLACKLIST_FORCE_VALIDATOR_PERMIT=True # Force validator permit for blacklisting
Then, start your miner with:
chmod +x ./start_miner.sh
./start_miner.shThis will launch run_neuron.py using Poetry.
You can also optionally run a cache updater service to improve image caching performance:
chmod +x ./start_cache_updater.sh
./start_cache_updater.shThis invokes natix/validator/scripts/run_cache_updater.py in the background.
Update your miner.env file to use your trained detector class and configuration.
- Detector types are defined in
base_miner/registry.py. - Config files live in
base_miner/detectors/configs/. - UCFDetector requires a
train_configpath in its config YAML.
Weights should be placed under base_miner/<detector_type>/weights. If missing, they will be pulled from Hugging Face according to the hf_repo field in the config.
To improve beyond the baseline model, experiment with new datasets, architectures, or hyperparameters.
Start TensorBoard to view training metrics:
tensorboard --logdir=./base_miner/checkpoints/<experiment_name>For remote machines:
ssh -L 7007:localhost:6006 your_username@your_ipThen on the remote machine:
tensorboard --logdir=./base_miner/checkpoints/<experiment_name> --host 0.0.0.0 --port 6006View it locally at http://localhost:7007