-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:Oneflow-Inc/CoModels into main
- Loading branch information
Showing
1,406 changed files
with
23,147 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1 @@ | ||
# Models implemented with OneFlow framework. | ||
|
||
- cv | ||
- nlp | ||
- [text_classfication](./nlp/text_classfication/) | ||
- [odd_numbers](./nlp/odd_numbers/) | ||
- science | ||
- audio | ||
- vidio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
## cait_M36_384 | ||
|
||
### Installation | ||
- Install the latest version of OneFlow | ||
```bash | ||
python3 -m pip install oneflow -f https://staging.oneflow.info/branch/master/[PLATFORM] | ||
``` | ||
Find more information on [install oneflow](https://github.com/Oneflow-Inc/oneflow#install-oneflow) | ||
|
||
- Install flowvision | ||
|
||
Then install the latest stable release of flowvision | ||
|
||
```bash | ||
pip install flowvision==0.2.1 | ||
``` | ||
|
||
- Install other requirements | ||
```bash | ||
python3 -m pip install -r requirements.txt | ||
``` | ||
|
||
### Dataset | ||
#### ImageNet | ||
For ImageNet dataset, you can download it from http://image-net.org/. We provide the following two ways to load data: | ||
|
||
- For standard folder dataset, move validation images to labeled sub-folders. The file structure should look like: | ||
```bash | ||
$ tree data | ||
imagenet | ||
├── train | ||
│ ├── class1 | ||
│ │ ├── img1.jpeg | ||
│ │ ├── img2.jpeg | ||
│ │ └── ... | ||
│ ├── class2 | ||
│ │ ├── img3.jpeg | ||
│ │ └── ... | ||
│ └── ... | ||
└── val | ||
├── class1 | ||
│ ├── img4.jpeg | ||
│ ├── img5.jpeg | ||
│ └── ... | ||
├── class2 | ||
│ ├── img6.jpeg | ||
│ └── ... | ||
└── ... | ||
|
||
|
||
### Training | ||
|
||
You can use bash script `train.sh` to train this model. | ||
|
||
```bash | ||
sh train.sh | ||
``` | ||
|
||
### inference | ||
|
||
Bash script `infer.sh` is used to infer the trained model. | ||
|
||
```bash | ||
sh infer.sh | ||
``` | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export PYTHONPATH=$PWD:$PYTHONPATH | ||
set -aux | ||
|
||
GPU_NUMS=1 | ||
PORT=12346 | ||
MODEL_ARCH="cait_M36_384" | ||
|
||
python3 -m oneflow.distributed.launch \ | ||
--nproc_per_node $GPU_NUMS \ | ||
--master_addr 127.0.0.1 \ | ||
--master_port $PORT \ | ||
main.py \ | ||
--cfg configs/default_settings.yaml \ | ||
--model_arch $MODEL_ARCH \ | ||
--lr 1e-5 \ | ||
--image-size 384 \ | ||
--throughput | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export PYTHONPATH=$PWD:$PYTHONPATH | ||
set -aux | ||
|
||
GPU_NUMS=8 | ||
PORT=12346 | ||
MODEL_ARCH="cait_M36_384" | ||
|
||
python3 -m oneflow.distributed.launch \ | ||
--nproc_per_node $GPU_NUMS \ | ||
--master_addr 127.0.0.1 \ | ||
--master_port $PORT \ | ||
main.py \ | ||
--cfg configs/default_settings.yaml \ | ||
--model_arch $MODEL_ARCH \ | ||
--lr 1e-5 \ | ||
--batch-size 8 \ | ||
--image-size 384 | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
## cait_M48_448 | ||
|
||
### Installation | ||
- Install the latest version of OneFlow | ||
```bash | ||
python3 -m pip install oneflow -f https://staging.oneflow.info/branch/master/[PLATFORM] | ||
``` | ||
Find more information on [install oneflow](https://github.com/Oneflow-Inc/oneflow#install-oneflow) | ||
|
||
- Install flowvision | ||
|
||
Then install the latest stable release of flowvision | ||
|
||
```bash | ||
pip install flowvision==0.2.1 | ||
``` | ||
|
||
- Install other requirements | ||
```bash | ||
python3 -m pip install -r requirements.txt | ||
``` | ||
|
||
### Dataset | ||
#### ImageNet | ||
For ImageNet dataset, you can download it from http://image-net.org/. We provide the following two ways to load data: | ||
|
||
- For standard folder dataset, move validation images to labeled sub-folders. The file structure should look like: | ||
```bash | ||
$ tree data | ||
imagenet | ||
├── train | ||
│ ├── class1 | ||
│ │ ├── img1.jpeg | ||
│ │ ├── img2.jpeg | ||
│ │ └── ... | ||
│ ├── class2 | ||
│ │ ├── img3.jpeg | ||
│ │ └── ... | ||
│ └── ... | ||
└── val | ||
├── class1 | ||
│ ├── img4.jpeg | ||
│ ├── img5.jpeg | ||
│ └── ... | ||
├── class2 | ||
│ ├── img6.jpeg | ||
│ └── ... | ||
└── ... | ||
|
||
|
||
### Training | ||
|
||
You can use bash script `train.sh` to train this model. | ||
|
||
```bash | ||
sh train.sh | ||
``` | ||
|
||
### inference | ||
|
||
Bash script `infer.sh` is used to infer the trained model. | ||
|
||
```bash | ||
sh infer.sh | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../config.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../configs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export PYTHONPATH=$PWD:$PYTHONPATH | ||
set -aux | ||
|
||
GPU_NUMS=1 | ||
PORT=12346 | ||
MODEL_ARCH="cait_M48_448" | ||
|
||
python3 -m oneflow.distributed.launch \ | ||
--nproc_per_node $GPU_NUMS \ | ||
--master_addr 127.0.0.1 \ | ||
--master_port $PORT \ | ||
main.py \ | ||
--cfg configs/default_settings.yaml \ | ||
--model_arch $MODEL_ARCH \ | ||
--lr 1e-5 \ | ||
--image-size 448 \ | ||
--throughput | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../logger.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../lr_scheduler.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../optimizer.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export PYTHONPATH=$PWD:$PYTHONPATH | ||
set -aux | ||
|
||
GPU_NUMS=8 | ||
PORT=12346 | ||
MODEL_ARCH="cait_M48_448" | ||
|
||
python3 -m oneflow.distributed.launch \ | ||
--nproc_per_node $GPU_NUMS \ | ||
--master_addr 127.0.0.1 \ | ||
--master_port $PORT \ | ||
main.py \ | ||
--cfg configs/default_settings.yaml \ | ||
--model_arch $MODEL_ARCH \ | ||
--lr 1e-5 \ | ||
--image-size 448 \ | ||
--batch-size 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../utils.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
## cait_S24_384 | ||
|
||
### Installation | ||
- Install the latest version of OneFlow | ||
```bash | ||
python3 -m pip install oneflow -f https://staging.oneflow.info/branch/master/[PLATFORM] | ||
``` | ||
Find more information on [install oneflow](https://github.com/Oneflow-Inc/oneflow#install-oneflow) | ||
|
||
- Install flowvision | ||
|
||
Then install the latest stable release of flowvision | ||
|
||
```bash | ||
pip install flowvision==0.2.1 | ||
``` | ||
|
||
- Install other requirements | ||
```bash | ||
python3 -m pip install -r requirements.txt | ||
``` | ||
|
||
### Dataset | ||
#### ImageNet | ||
For ImageNet dataset, you can download it from http://image-net.org/. We provide the following two ways to load data: | ||
|
||
- For standard folder dataset, move validation images to labeled sub-folders. The file structure should look like: | ||
```bash | ||
$ tree data | ||
imagenet | ||
├── train | ||
│ ├── class1 | ||
│ │ ├── img1.jpeg | ||
│ │ ├── img2.jpeg | ||
│ │ └── ... | ||
│ ├── class2 | ||
│ │ ├── img3.jpeg | ||
│ │ └── ... | ||
│ └── ... | ||
└── val | ||
├── class1 | ||
│ ├── img4.jpeg | ||
│ ├── img5.jpeg | ||
│ └── ... | ||
├── class2 | ||
│ ├── img6.jpeg | ||
│ └── ... | ||
└── ... | ||
|
||
|
||
### Training | ||
|
||
You can use bash script `train.sh` to train this model. | ||
|
||
```bash | ||
sh train.sh | ||
``` | ||
|
||
### inference | ||
|
||
Bash script `infer.sh` is used to infer the trained model. | ||
|
||
```bash | ||
sh infer.sh | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../config.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../configs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export PYTHONPATH=$PWD:$PYTHONPATH | ||
set -aux | ||
|
||
GPU_NUMS=1 | ||
PORT=12346 | ||
MODEL_ARCH="cait_S24_384" | ||
|
||
python3 -m oneflow.distributed.launch \ | ||
--nproc_per_node $GPU_NUMS \ | ||
--master_addr 127.0.0.1 \ | ||
--master_port $PORT \ | ||
main.py \ | ||
--cfg configs/default_settings.yaml \ | ||
--model_arch $MODEL_ARCH \ | ||
--lr 1e-5 \ | ||
--image-size 384 \ | ||
--throughput | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../logger.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../lr_scheduler.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../main.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../optimizer.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../requirements.txt |
Oops, something went wrong.