Comments (3)
Yes, you can refer to /pretrain/README.md for the complete cmd, which is:
$ cd /path/to/SparK/pretrain
$ torchrun --nproc_per_node=8 --nnodes=1 --node_rank=0 --master_addr=localhost --master_port=<some_port> main.py \
--data_path=/path/to/imagenet --exp_name=<your_exp_name> --exp_dir=/path/to/logdir \
--model=resnet50 --bs=512
The first line is missing, e.g. main.py
is the training_script.
from spark.
Thank you very much. In the article, it is saying that 'All models are pre-trained with 1.28 million unlabeled images
from ImageNet-1K (Deng et al., 2009) training set for 1600 epochs.', which means that I can use SparK pretraining with unlabeled dataset. However, when I tried to use unlabeled image dataset , the following error is happening:
File "/home/user/SparK/pretrain/utils/imagenet.py", line 39, in init
super(ImageNetDataset, self).init(
File "/home/user/.local/lib/python3.10/site-packages/torchvision/datasets/folder.py", line 144, in init
classes, class_to_idx = self.find_classes(self.root)
File "/home/user/.local/lib/python3.10/site-packages/torchvision/datasets/folder.py", line 218, in find_classes
return find_classes(directory)
File "/home/user/.local/lib/python3.10/site-packages/torchvision/datasets/folder.py", line 42, in find_classes
raise FileNotFoundError(f"Couldn't find any class folder in {directory}.")
from spark.
You need to define a new Python class for your dataset, to replace our ImageNetDataset in https://github.com/keyu-tian/SparK/blob/main/pretrain/utils/imagenet.py#L30. Just define a class with __len__(self)
and __getitem__(self, index: int)
implemented. The getitem should return the index-th image in your dataset, and be processed by a transformation like the trans_train
in /pretrain/utils/imagenet.py.
PS: i recommend to try your pretraining with or without --init_weight=/path/to/res50_withdecoder_1kpretrained_spark_style.pth
. If this arg is used, you will pretrain from our pretrained model, rather than from scratch, which could be better.
from spark.
Related Issues (20)
- 小模型自监督效果 HOT 10
- Can not load the pretrained convnext_small model HOT 2
- Spark.forward HOT 1
- infer问题 HOT 3
- There is no activation after the 2nd Conv in each decoder block HOT 1
- Target dataset and augmentation HOT 2
- 对比convnextv2 HOT 1
- reducing pre-training to 200 epochs HOT 9
- Tutorial for finetune on my own dataset HOT 1
- Are there any plans to make a port to tensorflow and Keras? HOT 1
- ImageNet finetuning exploding HOT 9
- there is no requirements.txt file. HOT 1
- SparK for semantic segmentation HOT 3
- Resuming ImageNet fine-tuning HOT 2
- About sparse convolution HOT 4
- How to transfer this method to 3D situation. HOT 1
- ConvNext B for reconstruct images HOT 3
- recommend a great library designed for sparse tensors HOT 1
- Can SparK be used for few-shot learning? HOT 2
- SparseBatchNorm2d can not mask correctly ? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spark.