internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: googleapis/google-cloud-python

Issue:
RST_STREAM error from grpc via Bidi in Firestore Client Library
Implementing a watch/listen in Firestore, waiting a while (some reports of 30, 60, and 120 minutes) results in an unhandled RST_STREAM error. We should investigate if this can be handled.

Related to https://github.com/firebase/firebase-admin-python/issues/282

```
google-api-core==1.14.3
google-auth==1.7.1
google-cloud-core==1.0.3
google-cloud-firestore==1.6.0
googleapis-common-protos==1.6.0
grpcio==1.25.0
```

Output and repro code at: https://gist.github.com/crwilcox/0ed944c7afa70a6a78dd8e8e76ebf1fd


Discussion:
In Go we retry on far more error codes, 
https://github.com/googleapis/google-cloud-go/blob/be07a624a2e4501df135ab7f731b7cfb408d9df2/firestore/watch.go#L507

`codes.Unknown, codes.DeadlineExceeded, codes.ResourceExhausted, codes.Internal, codes.Unavailable, codes.Unauthenticated`


Resolving patch:
diff --git a/firestore/google/cloud/firestore_v1/watch.py b/firestore/google/cloud/firestore_v1/watch.py
--- a/firestore/google/cloud/firestore_v1/watch.py
+++ b/firestore/google/cloud/firestore_v1/watch.py
@@ -57,7 +57,16 @@
     "DO_NOT_USE": -1,
 }
 _RPC_ERROR_THREAD_NAME = "Thread-OnRpcTerminated"
-_RECOVERABLE_STREAM_EXCEPTIONS = (exceptions.ServiceUnavailable,)
+_RECOVERABLE_STREAM_EXCEPTIONS = (
+    exceptions.Aborted,
+    exceptions.Cancelled,
+    exceptions.Unknown,
+    exceptions.DeadlineExceeded,
+    exceptions.ResourceExhausted,
+    exceptions.InternalServerError,
+    exceptions.ServiceUnavailable,
+    exceptions.Unauthenticated,
+)
 _TERMINATING_STREAM_EXCEPTIONS = (exceptions.Cancelled,)
 
 DocTreeEntry = collections.namedtuple("DocTreeEntry", ["value", "index"])


Test patch:
Repository: googleapis/google-cloud-python

Issue:
BigQuery: Dependency pins may be inadequate
When this PR, https://github.com/googleapis/google-cloud-python/pull/9915, shipped as `google-cloud-core=1.1.0` the core dep likely needs the minimum version rev'd

```
    "google-auth >= 1.9.0, < 2.0dev",
    "google-api-core >= 1.15.0, < 2.0dev",
    "google-cloud-core >= 1.0.3, < 2.0dev"
```


Discussion:

Resolving patch:
diff --git a/bigquery/setup.py b/bigquery/setup.py
--- a/bigquery/setup.py
+++ b/bigquery/setup.py
@@ -32,8 +32,8 @@
     'enum34; python_version < "3.4"',
     "google-auth >= 1.9.0, < 2.0dev",
     "google-api-core >= 1.15.0, < 2.0dev",
-    "google-cloud-core >= 1.0.3, < 2.0dev",
-    "google-resumable-media >= 0.3.1, != 0.4.0, < 0.6.0dev",
+    "google-cloud-core >= 1.1.0, < 2.0dev",
+    "google-resumable-media >= 0.5.0, < 0.6dev",
     "protobuf >= 3.6.0",
     "six >=1.13.0,< 2.0.0dev",
 ]


Test patch:
Repository: googleapis/google-cloud-python

Issue:
Test for "if not PY2" in compatibility code, rather than "if PY3"
At a few place the Python 2/3 compatibility code tests if Python 3 is used, assuming the "else" scenario is Python 2. Such tests will break if Python 4 (or some other post-3 version) is ever released.

The fix is to instead split the code paths into "Python 2" and "not Python 2" groups.




Discussion:

Resolving patch:
diff --git a/pubsub/synth.py b/pubsub/synth.py
--- a/pubsub/synth.py
+++ b/pubsub/synth.py
@@ -127,10 +127,10 @@
     "google/cloud/pubsub_v1/gapic/publisher_client.py",
     "class PublisherClient",
     """# TODO: remove conditional import after Python 2 support is dropped
-if six.PY3:
-    from collections.abc import Mapping
-else:
+if six.PY2:
     from collections import Mapping
+else:
+    from collections.abc import Mapping
     
 
 def _merge_dict(d1, d2):
diff --git a/storage/google/cloud/storage/batch.py b/storage/google/cloud/storage/batch.py
--- a/storage/google/cloud/storage/batch.py
+++ b/storage/google/cloud/storage/batch.py
@@ -214,10 +214,10 @@ def _prepare_batch_request(self):
             timeout = _timeout
 
         # The `email` package expects to deal with "native" strings
-        if six.PY3:  # pragma: NO COVER  Python3
-            buf = io.StringIO()
-        else:
+        if six.PY2:  # pragma: NO COVER  Python3
             buf = io.BytesIO()
+        else:
+            buf = io.StringIO()
         generator = Generator(buf, False, 0)
         generator.flatten(multi)
         payload = buf.getvalue()


Test patch:
diff --git a/logging/tests/unit/handlers/test__helpers.py b/logging/tests/unit/handlers/test__helpers.py
--- a/logging/tests/unit/handlers/test__helpers.py
+++ b/logging/tests/unit/handlers/test__helpers.py
@@ -77,7 +77,7 @@ def get(self):
         self.response.out.write(json.dumps(trace_id))
 
 
-@unittest.skipIf(six.PY3, "webapp2 is Python 2 only")
+@unittest.skipIf(not six.PY2, "webapp2 is Python 2 only")
 class Test_get_trace_id_from_webapp2(unittest.TestCase):
     @staticmethod
     def create_app():
diff --git a/storage/tests/unit/test__signing.py b/storage/tests/unit/test__signing.py
--- a/storage/tests/unit/test__signing.py
+++ b/storage/tests/unit/test__signing.py
@@ -69,8 +69,8 @@ def test_w_expiration_int(self):
         self.assertEqual(self._call_fut(123), 123)
 
     def test_w_expiration_long(self):
-        if six.PY3:
-            raise unittest.SkipTest("No long on Python 3")
+        if not six.PY2:
+            raise unittest.SkipTest("No long on Python 3+")
 
         self.assertEqual(self._call_fut(long(123)), 123)  # noqa: F821
Repository: googleapis/google-cloud-python

Issue:
Language: typo ("spech") in Natural Language samples
#### Environment details

N/A

#### Steps to reproduce

N/A

#### Code example

Comments say "Parts of spech" instead of "Parts of speech"
https://github.com/googleapis/google-cloud-python/blob/master/language/samples/v1/language_syntax_gcs.py#L67
https://github.com/googleapis/google-cloud-python/blob/master/language/samples/v1/language_syntax_text.py#L66




Discussion:

Resolving patch:
diff --git a/language/samples/v1/language_syntax_gcs.py b/language/samples/v1/language_syntax_gcs.py
--- a/language/samples/v1/language_syntax_gcs.py
+++ b/language/samples/v1/language_syntax_gcs.py
@@ -64,7 +64,7 @@ def sample_analyze_syntax(gcs_content_uri):
             u"Location of this token in overall document: {}".format(text.begin_offset)
         )
         # Get the part of speech information for this token.
-        # Parts of spech are as defined in:
+        # Parts of speech are as defined in:
         # http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
         part_of_speech = token.part_of_speech
         # Get the tag, e.g. NOUN, ADJ for Adjective, et al.
diff --git a/language/samples/v1/language_syntax_text.py b/language/samples/v1/language_syntax_text.py
--- a/language/samples/v1/language_syntax_text.py
+++ b/language/samples/v1/language_syntax_text.py
@@ -63,7 +63,7 @@ def sample_analyze_syntax(text_content):
             u"Location of this token in overall document: {}".format(text.begin_offset)
         )
         # Get the part of speech information for this token.
-        # Parts of spech are as defined in:
+        # Parts of speech are as defined in:
         # http://www.lrec-conf.org/proceedings/lrec2012/pdf/274_Paper.pdf
         part_of_speech = token.part_of_speech
         # Get the tag, e.g. NOUN, ADJ for Adjective, et al.


Test patch:
Repository: googleapis/google-cloud-python

Issue:
PubSub: declaratively drop Python 3.4 support
The README and the language classifiers in `setup.py`  both only claim support for Python 3.5+ (and 2.7), but not Python 3.4. However, the `python_requires` in `setup.py` does not reflect that, and does not prevent installing the library in Python 3.4.


Discussion:

Resolving patch:
diff --git a/pubsub/setup.py b/pubsub/setup.py
--- a/pubsub/setup.py
+++ b/pubsub/setup.py
@@ -84,7 +84,7 @@
     namespace_packages=namespaces,
     install_requires=dependencies,
     extras_require=extras,
-    python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
+    python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*",
     include_package_data=True,
     zip_safe=False,
 )


Test patch:
Repository: googleapis/google-cloud-python

Issue:
BigQuery: Release 1.24.0
Last release was December 16, and we've had quite a few enhancements and bug fixes since then. Let's cut a release before we do the repo move.


Discussion:
If nobody takes over the BigQuery repo split from me by Monday, I will make the release first and then start with the split.

Resolving patch:
diff --git a/bigquery/setup.py b/bigquery/setup.py
--- a/bigquery/setup.py
+++ b/bigquery/setup.py
@@ -22,7 +22,7 @@
 
 name = "google-cloud-bigquery"
 description = "Google BigQuery API client library"
-version = "1.23.1"
+version = "1.24.0"
 # Should be one of:
 # 'Development Status :: 3 - Alpha'
 # 'Development Status :: 4 - Beta'


Test patch:
Repository: googleapis/google-cloud-python

Issue:
Use Github Search repositories instead of getting all repos
I noticed that the script uses the [`List organization repositories`](https://docs.github.com/en/rest/repos/repos#list-organization-repositories) endpoint. However, this command asks to recover all the repos (useless data) then to filter.
It would be more relevant to use the [`Search repositories`](https://docs.github.com/en/rest/search#search-repositories) endpoint.

A simple example would be : https://api.github.com/search/repositories?q=org:googleapis+python%20in:name

We can of course improve, what do you think?


Discussion:
Hello @av1m,

Thanks for the suggestion! PRs are welcome if you're interested in contributing.
Ok, I'll do that when I have a moment. Thanks 🙂

Resolving patch:
diff --git a/scripts/updateapilist.py b/scripts/updateapilist.py
--- a/scripts/updateapilist.py
+++ b/scripts/updateapilist.py
@@ -117,7 +117,6 @@ def client_for_repo(repo_slug) -> Optional[CloudClient]:
 
     return CloudClient(response.json())
 
-REPO_LIST_JSON = "https://api.github.com/orgs/googleapis/repos?per_page=100&page={page_number}"
 REPO_EXCLUSION = [
     # core libraries
     "googleapis/python-api-core",
@@ -150,15 +149,17 @@ def all_clients() -> List[CloudClient]:
 
     while first_request or 'next' in response.links:
         if first_request:
-            url = REPO_LIST_JSON.format(page_number=1)
+            url = "https://api.github.com/search/repositories?page=1"
             first_request = False
         else:
             url = response.links['next']['url']
         headers = {'Authorization': f'token {token}'}
-        response = requests.get(url=url, headers= headers)
-        if len(response.json()) == 0:
+        params = {'per_page': 100, "q": "python- in:name org:googleapis"}
+        response = requests.get(url=url, params=params, headers=headers)
+        repositories = response.json().get("items", [])
+        if len(repositories) == 0:
             break
-        clients.extend(get_clients_batch_from_response_json(response.json()))
+        clients.extend(get_clients_batch_from_response_json(repositories))
 
     # remove empty clients
     return [client for client in clients if client]


Test patch:
Repository: googleapis/google-cloud-python

Issue:
[docs issue] index.rst got updated to  exclude sub-directories with services in google-apps-script-type
Refer to the the file `packages/google-apps-script-type/docs/index.rst` in #11845. This should probably be blocker for public release.



Discussion:

Resolving patch:
diff --git a/packages/google-apps-script-type/noxfile.py b/packages/google-apps-script-type/noxfile.py
--- a/packages/google-apps-script-type/noxfile.py
+++ b/packages/google-apps-script-type/noxfile.py
@@ -29,8 +29,10 @@
 
 BLACK_VERSION = "black[jupyter]==23.7.0"
 ISORT_VERSION = "isort==5.11.0"
+
 LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
 
+
 DEFAULT_PYTHON_VERSION = "3.9"
 
 UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
@@ -89,6 +91,7 @@ def lint(session):
         "--check",
         *LINT_PATHS,
     )
+
     session.run("flake8", "google", "tests")
 
 


Test patch:
Repository: autogluon/autogluon

Issue:
Missing best config after fit for object detection fit example
After executing object detection example, it only produces:

```
INFO:autogluon.task.object_detection.object_detection:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> finish model fitting
INFO:autogluon.task.object_detection.object_detection:The best config:
```
while no best config is reported.

Might relate to https://github.com/awslabs/autogluon/issues/29


Discussion:

Resolving patch:
diff --git a/autogluon/task/object_detection/object_detection.py b/autogluon/task/object_detection/object_detection.py
--- a/autogluon/task/object_detection/object_detection.py
+++ b/autogluon/task/object_detection/object_detection.py
@@ -178,7 +178,7 @@ def fit(dataset='voc',
                                    scheduler_options)
         logger.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> finish model fitting")
         args = sample_config(train_object_detection.args, results['best_config'])
-        logger.info('The best config:\n', results['best_config'])
+        logger.info('The best config: {}'.format(results['best_config']))
 
         model = get_network(args.net, dataset.init().get_classes(), mx.cpu(0))
         update_params(model, results.pop('model_params'))


Test patch:
Repository: autogluon/autogluon

Issue:
About ENAS_Scheduler
While using ENAS_Scheduler
Maybe：
```
tbar.set_description('avg reward: {}'.format(self.baseline))
```
is better than 

```
tbar.set_description('avg reward: {:.2f}'.format(self.baseline))
```
in run in enas_scheduler.py, because when self.baseline=None, it will report error


Discussion:

Resolving patch:
diff --git a/autogluon/contrib/enas/enas_scheduler.py b/autogluon/contrib/enas/enas_scheduler.py
--- a/autogluon/contrib/enas/enas_scheduler.py
+++ b/autogluon/contrib/enas/enas_scheduler.py
@@ -126,12 +126,15 @@ def run(self):
                     graph = self.supernet.graph
                     graph.attr(rankdir='LR', size='8,3')
                     tbar.set_svg(graph._repr_svg_())
-                tbar.set_description('avg reward: {:.2f}'.format(self.baseline))
+                if self.baseline:
+                    tbar.set_description('avg reward: {:.2f}'.format(self.baseline))
                 idx += 1
             self.validation()
             self.save()
-            tq.set_description('epoch {}, val_acc: {:.2f}, avg reward: {:.2f}' \
-                        .format(epoch, self.val_acc, self.baseline))
+            msg = 'epoch {}, val_acc: {:.2f}'.format(epoch, self.val_acc)
+            if self.baseline:
+                msg += ', avg reward: {:.2f}'.format(self.baseline)
+            tq.set_description(msg)
 
     def validation(self):
         if hasattr(self.val_data, 'reset'): self.val_data.reset()


Test patch:
Repository: autogluon/autogluon

Issue:
Import error caused by removed private scikit-learn function
Import error using autogluon 0.0.10 and scikit-learn 0.23.1:

```python
import autogluon
```

Error: `ImportError: cannot import name '_argmax'`, caused by

https://github.com/awslabs/autogluon/blob/566a00c552c1ecde8d8e8b433500aa0b46fdfc6b/autogluon/utils/tabular/ml/models/tabular_nn/categorical_encoders.py#L13

`_argmax` was removed from `sklearn.utils.fixes` in https://github.com/scikit-learn/scikit-learn/commit/75d3f29e724c9a2db7bcb5afb2d7e8c08ddbd80b.


Discussion:

Resolving patch:
diff --git a/autogluon/utils/tabular/ml/models/tabular_nn/categorical_encoders.py b/autogluon/utils/tabular/ml/models/tabular_nn/categorical_encoders.py
--- a/autogluon/utils/tabular/ml/models/tabular_nn/categorical_encoders.py
+++ b/autogluon/utils/tabular/ml/models/tabular_nn/categorical_encoders.py
@@ -10,7 +10,6 @@
 
 from sklearn.base import BaseEstimator, TransformerMixin
 from sklearn.utils import check_array
-from sklearn.utils.fixes import _argmax
 from sklearn.utils.validation import check_is_fitted
 
 
@@ -641,9 +640,8 @@ def inverse_transform(self, X):
                 X_tr[:, i] = self.categories_[i][self.drop_idx_[i]]
                 j += n_categories
                 continue
-            sub = X[:, j:j + n_categories]
-            # for sparse X argmax returns 2D matrix, ensure 1D array
-            labels = np.asarray(_argmax(sub, axis=1)).flatten()
+            sub = X[:, j:j + n_categories]  # for sparse X argmax returns 2D matrix, ensure 1D array
+            labels = np.asarray(sub.argmax(axis=1)).flatten()
             X_tr[:, i] = cats[labels]
             if self.handle_unknown == 'ignore':
                 unknown = np.asarray(sub.sum(axis=1) == 0).flatten()


Test patch:
Repository: autogluon/autogluon

Issue:
Update scikit-learn-intelex version
- [ ] Check if scikit-learn-intelex can be upgraded.


Discussion:

Resolving patch:
diff --git a/tabular/setup.py b/tabular/setup.py
--- a/tabular/setup.py
+++ b/tabular/setup.py
@@ -50,7 +50,8 @@
         f'{ag.PACKAGE_NAME}.core[all]=={version}',
     ],
     'skex': [
-        'scikit-learn-intelex>=2021.6,<2021.8',
+        # Note: 2021.7 released on Sep 2022, version 2022.x doesn't exist (went directly from 2021.7 to 2023.0)
+        'scikit-learn-intelex>=2021.7,<2023.1',
     ],
     'imodels': [
         'imodels>=1.3.10,<1.4.0',  # 1.3.8/1.3.9 either remove/renamed attribute `complexity_` causing failures. https://github.com/csinva/imodels/issues/147


Test patch:
Repository: PaddlePaddle/PaddleDetection

Issue:
检测结果可视化脚本运行报错
请帮忙看下这个报错，paddle version：1.7.1，master分支和0.2分支都有同样问题
参考文档：
https://github.com/PaddlePaddle/PaddleDetection/blob/release/0.2/docs/advanced_tutorials/inference/DEPLOYMENT.md

`
root@eric-VirtualBox:/home/eric/project/PaddleDetection/inference/build# python ../tools/vis.py --img_path=jpeg/chinamap_a236.jpg --img_result_path=jpeg/chinamap_a236.jpg.pb --threshold=0.1 --c2l_path=../tools/chinamap.json
Traceback (most recent call last):
  File "../tools/vis.py", line 83, in <module>
    with open(Flags.c2l_path, "r", encoding="utf-8") as json_f:
TypeError: 'encoding' is an invalid keyword argument for this function
root@eric-VirtualBox:/home/eric/project/PaddleDetection/inference/build#
`




Discussion:
@itslgl 请将`vis.py`的第83行改为：
```python
import io
with io.open(Flags.c2l_path, "r", encoding="utf-8") as json_f:
...
```
如果此方法有效，请反馈一下，open方法与io.open不一样，如果io.open有效，我们会改进一下此代码。
这样改可以，谢谢！


Resolving patch:
diff --git a/inference/tools/vis.py b/inference/tools/vis.py
--- a/inference/tools/vis.py
+++ b/inference/tools/vis.py
@@ -20,6 +20,7 @@
 import numpy as np
 import json
 from PIL import Image, ImageDraw, ImageFont
+import io
 
 Flags = gflags.FLAGS
 gflags.DEFINE_string('img_path', 'abc', 'image path')
@@ -80,7 +81,7 @@ def colormap(rgb=False):
             img = cv2.imread(Flags.img_path)
             img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
             class2LabelMap = dict()
-            with open(Flags.c2l_path, "r", encoding="utf-8") as json_f:
+            with io.open(Flags.c2l_path, "r", encoding="utf-8") as json_f:
                 class2LabelMap = json.load(json_f)
                 for box in detection_result.detection_boxes:
                     if box.score >= Flags.threshold:


Test patch:
Repository: PaddlePaddle/PaddleDetection

Issue:
开发小哥，deploy/python/infer.py文件，521行的FLAGS，写成了FLAGES



Discussion:

Resolving patch:
diff --git a/deploy/python/infer.py b/deploy/python/infer.py
--- a/deploy/python/infer.py
+++ b/deploy/python/infer.py
@@ -518,7 +518,7 @@ def predict_video():
     fourcc = cv2.VideoWriter_fourcc(*'mp4v')
     video_name = os.path.split(FLAGS.video_file)[-1]
     if not os.path.exists(FLAGS.output_dir):
-        os.makedirs(FLAGES.output_dir)
+        os.makedirs(FLAGS.output_dir)
     out_path = os.path.join(FLAGS.output_dir, video_name)
     writer = cv2.VideoWriter(out_path, fourcc, fps, (width, height))
     index = 1


Test patch:
Repository: PaddlePaddle/PaddleDetection

Issue:
使用yolov3_mobilenet_v1_voc.yml训练时出错
Traceback (most recent call last):
  File "tools/train.py", line 372, in <module>
    main()
  File "tools/train.py", line 70, in main
    cfg = load_config(FLAGS.config)
  File "/home/aistudio/PaddleDetection/ppdet/core/workspace.py", line 86, in load_config
    cfg = merge_config(yaml.load(f, Loader=yaml.Loader), cfg)
  File "/home/aistudio/PaddleDetection/ppdet/core/workspace.py", line 143, in merge_config
    dct['train_batch_size'] = dct['TrainReader']['batch_size']
KeyError: 'batch_size'


Discussion:
@txssg 请在config配置文件的TrainReader中加入`batch_size: 8`,这个问题我们会马上修复。

Resolving patch:
diff --git a/ppdet/core/workspace.py b/ppdet/core/workspace.py
--- a/ppdet/core/workspace.py
+++ b/ppdet/core/workspace.py
@@ -139,7 +139,7 @@ def merge_config(config, another_cfg=None):
     #       batch size config to global, models can get batch size config
     #       from global config when building model.
     #       batch size in evaluation or inference can also be added here
-    if 'TrainReader' in dct:
+    if 'TrainReader' in dct and 'batch_size' in dct['TrainReader']:
         dct['train_batch_size'] = dct['TrainReader']['batch_size']
 
     return dct


Test patch:
Repository: PaddlePaddle/PaddleDetection

Issue:
缺少根据exif信息对图像进行旋转的操作
https://github.com/PaddlePaddle/PaddleDetection/blob/e74203cfa70c8fa5d1bc7bde68345f0bc8d7d16e/tools/infer.py#L204

使用PIL的Image对图像进行打开后，默认不会对图形进行根据EXIF中记录翻转角度的信息进行翻转，造成最后在该图片上进行mask和bbox标识时，发生index溢出。

在该行下面添加

```python
image = ImageOps.exif_transpose(image)
```

即可。


Discussion:
@mikeshi80  非常感谢指出问题，我们也尽快修复下~

Resolving patch:
diff --git a/deploy/python/infer.py b/deploy/python/infer.py
--- a/deploy/python/infer.py
+++ b/deploy/python/infer.py
@@ -341,7 +341,7 @@ def check_model(self, yml_conf):
     def print_config(self):
         print('-----------  Model Configuration -----------')
         print('%s: %s' % ('Model Arch', self.arch))
-        print('%s: %s' % ('Use Padddle Executor', self.use_python_inference))
+        print('%s: %s' % ('Use Paddle Executor', self.use_python_inference))
         print('%s: ' % ('Transform Order'))
         for op_info in self.preprocess_infos:
             print('--%s: %s' % ('transform op', op_info['type']))
diff --git a/tools/infer.py b/tools/infer.py
--- a/tools/infer.py
+++ b/tools/infer.py
@@ -25,7 +25,7 @@
 import glob
 import numpy as np
 import six
-from PIL import Image
+from PIL import Image, ImageOps
 
 import paddle
 from paddle import fluid
@@ -205,6 +205,7 @@ def main():
         for im_id in im_ids:
             image_path = imid2path[int(im_id)]
             image = Image.open(image_path).convert('RGB')
+            image = ImageOps.exif_transpose(image)
 
             # use VisualDL to log original image
             if FLAGS.use_vdl:


Test patch: