Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
2237127a
Unverified
Commit
2237127a
authored
Apr 17, 2023
by
Matt
Committed by
GitHub
Apr 17, 2023
Browse files
Fix sneaky torch dependency in TF example (#22804)
parent
626c1b8a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
examples/tensorflow/image-classification/run_image_classification.py
...nsorflow/image-classification/run_image_classification.py
+2
-7
No files found.
examples/tensorflow/image-classification/run_image_classification.py
View file @
2237127a
...
...
@@ -34,7 +34,7 @@ from PIL import Image
import
transformers
from
transformers
import
(
MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING
,
TF_
MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING
,
AutoConfig
,
AutoImageProcessor
,
DefaultDataCollator
,
...
...
@@ -58,7 +58,7 @@ check_min_version("4.29.0.dev0")
require_version
(
"datasets>=1.8.0"
,
"To fix: pip install -r examples/pytorch/image-classification/requirements.txt"
)
MODEL_CONFIG_CLASSES
=
list
(
MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING
.
keys
())
MODEL_CONFIG_CLASSES
=
list
(
TF_
MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING
.
keys
())
MODEL_TYPES
=
tuple
(
conf
.
model_type
for
conf
in
MODEL_CONFIG_CLASSES
)
...
...
@@ -262,11 +262,6 @@ def main():
transformers
.
utils
.
logging
.
set_verbosity_info
()
transformers
.
utils
.
logging
.
enable_default_handler
()
transformers
.
utils
.
logging
.
enable_explicit_format
()
# Log on each process the small summary:
logger
.
warning
(
f
"Process rank:
{
training_args
.
local_rank
}
, device:
{
training_args
.
device
}
, n_gpu:
{
training_args
.
n_gpu
}
"
+
f
"distributed training:
{
bool
(
training_args
.
local_rank
!=
-
1
)
}
, 16-bits training:
{
training_args
.
fp16
}
"
)
logger
.
info
(
f
"Training/evaluation parameters
{
training_args
}
"
)
# region Dataset and labels
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment