parent
							
								
									206a6b7e5f
								
							
						
					
					
						commit
						c28839d24b
					
				
											
												Binary file not shown.
											
										
									
								| @ -0,0 +1,15 @@ | |||||||
|  | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. | ||||||
|  | # | ||||||
|  | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  | # you may not use this file except in compliance with the License. | ||||||
|  | # You may obtain a copy of the License at | ||||||
|  | # | ||||||
|  | #     http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  | # | ||||||
|  | # Unless required by applicable law or agreed to in writing, software | ||||||
|  | # distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  | # See the License for the specific language governing permissions and | ||||||
|  | # limitations under the License. | ||||||
|  | 
 | ||||||
|  | from . import infer | ||||||
| @ -0,0 +1,31 @@ | |||||||
|  | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||||||
|  | # | ||||||
|  | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  | # you may not use this file except in compliance with the License. | ||||||
|  | # You may obtain a copy of the License at | ||||||
|  | # | ||||||
|  | #     http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  | # | ||||||
|  | # Unless required by applicable law or agreed to in writing, software | ||||||
|  | # distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  | # See the License for the specific language governing permissions and | ||||||
|  | # limitations under the License. | ||||||
|  | 
 | ||||||
|  | from __future__ import absolute_import | ||||||
|  | from __future__ import division | ||||||
|  | from __future__ import print_function | ||||||
|  | import os | ||||||
|  | import sys | ||||||
|  | __dir__ = os.path.dirname(os.path.abspath(__file__)) | ||||||
|  | sys.path.append(os.path.abspath(os.path.join(__dir__, '../'))) | ||||||
|  | 
 | ||||||
|  | from ppcls.utils import config | ||||||
|  | from ppcls.engine.engine import Engine | ||||||
|  | 
 | ||||||
|  | if __name__ == "__main__": | ||||||
|  |     args = config.parse_args() | ||||||
|  |     config = config.get_config( | ||||||
|  |         args.config, overrides=args.override, show=False) | ||||||
|  |     engine = Engine(config, mode="eval") | ||||||
|  |     engine.eval() | ||||||
| @ -0,0 +1,7 @@ | |||||||
|  | #!/usr/bin/env bash | ||||||
|  | 
 | ||||||
|  | # for single card eval | ||||||
|  | # python3.7 tools/eval.py -c ./ppcls/configs/ImageNet/ResNet/ResNet50.yaml | ||||||
|  | 
 | ||||||
|  | # for multi-cards eval | ||||||
|  | python3.7 -m paddle.distributed.launch --gpus="0,1,2,3" tools/eval.py -c ./ppcls/configs/ImageNet/ResNet/ResNet50.yaml | ||||||
| @ -0,0 +1,34 @@ | |||||||
|  | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||||||
|  | # | ||||||
|  | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  | # you may not use this file except in compliance with the License. | ||||||
|  | # You may obtain a copy of the License at | ||||||
|  | # | ||||||
|  | #     http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  | # | ||||||
|  | # Unless required by applicable law or agreed to in writing, software | ||||||
|  | # distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  | # See the License for the specific language governing permissions and | ||||||
|  | # limitations under the License. | ||||||
|  | 
 | ||||||
|  | from __future__ import absolute_import | ||||||
|  | from __future__ import division | ||||||
|  | from __future__ import print_function | ||||||
|  | import os | ||||||
|  | import sys | ||||||
|  | __dir__ = os.path.dirname(os.path.abspath(__file__)) | ||||||
|  | sys.path.append(os.path.abspath(os.path.join(__dir__, '../'))) | ||||||
|  | 
 | ||||||
|  | import paddle | ||||||
|  | import paddle.nn as nn | ||||||
|  | 
 | ||||||
|  | from ppcls.utils import config | ||||||
|  | from ppcls.engine.engine import Engine | ||||||
|  | 
 | ||||||
|  | if __name__ == "__main__": | ||||||
|  |     args = config.parse_args() | ||||||
|  |     config = config.get_config( | ||||||
|  |         args.config, overrides=args.override, show=False) | ||||||
|  |     engine = Engine(config, mode="export") | ||||||
|  |     engine.export() | ||||||
| @ -0,0 +1,31 @@ | |||||||
|  | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||||||
|  | # | ||||||
|  | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  | # you may not use this file except in compliance with the License. | ||||||
|  | # You may obtain a copy of the License at | ||||||
|  | # | ||||||
|  | #     http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  | # | ||||||
|  | # Unless required by applicable law or agreed to in writing, software | ||||||
|  | # distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  | # See the License for the specific language governing permissions and | ||||||
|  | # limitations under the License. | ||||||
|  | 
 | ||||||
|  | from __future__ import absolute_import | ||||||
|  | from __future__ import division | ||||||
|  | from __future__ import print_function | ||||||
|  | import os | ||||||
|  | import sys | ||||||
|  | __dir__ = os.path.dirname(os.path.abspath(__file__)) | ||||||
|  | sys.path.append(os.path.abspath(os.path.join(__dir__, '../'))) | ||||||
|  | 
 | ||||||
|  | from ppcls.utils import config | ||||||
|  | from ppcls.engine.engine import Engine | ||||||
|  | 
 | ||||||
|  | if __name__ == "__main__": | ||||||
|  |     args = config.parse_args() | ||||||
|  |     config = config.get_config( | ||||||
|  |         args.config, overrides=args.override, show=False) | ||||||
|  |     engine = Engine(config, mode="infer") | ||||||
|  |     engine.infer() | ||||||
| @ -0,0 +1,32 @@ | |||||||
|  | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. | ||||||
|  | # | ||||||
|  | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
|  | # you may not use this file except in compliance with the License. | ||||||
|  | # You may obtain a copy of the License at | ||||||
|  | # | ||||||
|  | #     http://www.apache.org/licenses/LICENSE-2.0 | ||||||
|  | # | ||||||
|  | # Unless required by applicable law or agreed to in writing, software | ||||||
|  | # distributed under the License is distributed on an "AS IS" BASIS, | ||||||
|  | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
|  | # See the License for the specific language governing permissions and | ||||||
|  | # limitations under the License. | ||||||
|  | 
 | ||||||
|  | from __future__ import absolute_import | ||||||
|  | from __future__ import division | ||||||
|  | from __future__ import print_function | ||||||
|  | import os | ||||||
|  | import sys | ||||||
|  | __dir__ = os.path.dirname(os.path.abspath(__file__)) | ||||||
|  | sys.path.append(os.path.abspath(os.path.join(__dir__, '../'))) | ||||||
|  | 
 | ||||||
|  | from ppcls.utils import config | ||||||
|  | from ppcls.engine.engine import Engine | ||||||
|  | 
 | ||||||
|  | if __name__ == "__main__": | ||||||
|  |     args = config.parse_args() | ||||||
|  |     config = config.get_config( | ||||||
|  |         args.config, overrides=args.override, show=False) | ||||||
|  |     config.profiler_options = args.profiler_options | ||||||
|  |     engine = Engine(config, mode="train") | ||||||
|  |     engine.train() | ||||||
| @ -0,0 +1,8 @@ | |||||||
|  | #!/usr/bin/env bash | ||||||
|  | 
 | ||||||
|  | # for single card train | ||||||
|  | # python3.7 tools/train.py -c ./ppcls/configs/ImageNet/ResNet/ResNet50.yaml | ||||||
|  | 
 | ||||||
|  | # for multi-cards train | ||||||
|  | export CUDA_VISIBLE_DEVICES=0,1,2,3 | ||||||
|  | python3.7 -m paddle.distributed.launch --gpus="0,1,2,3" tools/train.py -c ./ppcls/configs/ImageNet/ResNet/ResNet50.yaml | ||||||
					Loading…
					
					
				
		Reference in new issue