{"action":"created","issue":{"url":"https://api.github.com/repos/zalandoresearch/flair/issues/82","repository_url":"https://api.github.com/repos/zalandoresearch/flair","labels_url":"https://api.github.com/repos/zalandoresearch/flair/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/zalandoresearch/flair/issues/82/comments","events_url":"https://api.github.com/repos/zalandoresearch/flair/issues/82/events","html_url":"https://github.com/zalandoresearch/flair/issues/82","id":352271132,"node_id":"MDU6SXNzdWUzNTIyNzExMzI=","number":82,"title":"Flair or one of its imports resets warning settings","user":{"login":"hcl14","id":2828322,"node_id":"MDQ6VXNlcjI4MjgzMjI=","avatar_url":"https://avatars3.githubusercontent.com/u/2828322?v=4","gravatar_id":"","url":"https://api.github.com/users/hcl14","html_url":"https://github.com/hcl14","followers_url":"https://api.github.com/users/hcl14/followers","following_url":"https://api.github.com/users/hcl14/following{/other_user}","gists_url":"https://api.github.com/users/hcl14/gists{/gist_id}","starred_url":"https://api.github.com/users/hcl14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hcl14/subscriptions","organizations_url":"https://api.github.com/users/hcl14/orgs","repos_url":"https://api.github.com/users/hcl14/repos","events_url":"https://api.github.com/users/hcl14/events{/privacy}","received_events_url":"https://api.github.com/users/hcl14/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-08-20T19:47:16Z","updated_at":"2018-10-16T08:50:46Z","closed_at":null,"author_association":"NONE","body":"Consider me running the following code:\r\n\r\n`test.py`:\r\n```\r\nimport numpy as np\r\nimport tensorflow as tf\r\n```\r\nIt issues very few warnings when launched:\r\n```\r\n$ python3 -i test.py\r\n/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88\r\n  return f(*args, **kwds)\r\n/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88\r\n  return f(*args, **kwds)\r\n```\r\n\r\nNow I put import of flair on top and I have whole lot of them shown:\r\n\r\n```\r\nprint(\"Loading flair NER\")\r\nfrom flair.models import SequenceTagger\r\nfrom flair.data import Sentence\r\n\r\ntagger = SequenceTagger.load('ner') \r\nprint(\"NER Loaded\")\r\n\r\nimport numpy as np\r\nimport tensorflow as tf \r\n```\r\n\r\nOutput:\r\n\r\n```\r\nLoading flair NER\r\nNER Loaded\r\n/usr/lib/python3.6/importlib/_bootstrap_external.py:426: ImportWarning: Not importing directory /home/hcl/.local/lib/python3.6/site-packages/google: missing __init__\r\n  _warnings.warn(msg.format(portions[0]), ImportWarning)\r\n/usr/lib/python3.6/importlib/_bootstrap_external.py:426: ImportWarning: Not importing directory /home/hcl/.local/lib/python3.6/site-packages/mpl_toolkits: missing __init__\r\n  _warnings.warn(msg.format(portions[0]), ImportWarning)\r\n/usr/lib/python3.6/importlib/_bootstrap_external.py:426: ImportWarning: Not importing directory /home/hcl/.local/lib/python3.6/site-packages/jaraco: missing __init__\r\n  _warnings.warn(msg.format(portions[0]), ImportWarning)\r\n/home/hcl/.local/lib/python3.6/site-packages/tensorflow/python/framework/ops.py:936: DeprecationWarning: builtin type EagerTensor has no __module__ attribute\r\n  EagerTensor = c_api.TFE_Py_InitEagerTensor(_EagerTensorBase)\r\n/home/hcl/.local/lib/python3.6/site-packages/tensorflow/python/util/tf_inspect.py:75: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()\r\n  return _inspect.getargspec(target)\r\n/home/hcl/.local/lib/python3.6/site-packages/tensorflow/python/keras/backend.py:4712: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/hcl/.keras/keras.json' mode='r' encoding='UTF-8'>\r\n  _config = json.load(open(_config_path))\r\n/usr/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n  return f(*args, **kwds)\r\n/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88\r\n  return f(*args, **kwds)\r\n/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88\r\n  return f(*args, **kwds)\r\n/usr/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__\r\n  return f(*args, **kwds)\r\n```\r\n\r\nThe warnings are of different types and are shown not only during import, but also when calling imported functions, which creates a lot of garbage in the output. I tried to return warning settings to the default level by doing\r\n\r\n```\r\nimport warnings\r\nwarnings.resetwarnings()\r\n```\r\n\r\nafter loading Flair, but it didn't help. All that is possible now for me is to completely silence warnings after importing Flair:\r\n\r\n```\r\nimport warnings\r\nwarnings.filterwarnings(\"ignore\")\r\n```\r\n\r\nbut this is not a good solution, because imports seem to show some important warnings (two in the first example)."},"comment":{"url":"https://api.github.com/repos/zalandoresearch/flair/issues/comments/430155257","html_url":"https://github.com/zalandoresearch/flair/issues/82#issuecomment-430155257","issue_url":"https://api.github.com/repos/zalandoresearch/flair/issues/82","id":430155257,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMDE1NTI1Nw==","user":{"login":"hcl14","id":2828322,"node_id":"MDQ6VXNlcjI4MjgzMjI=","avatar_url":"https://avatars3.githubusercontent.com/u/2828322?v=4","gravatar_id":"","url":"https://api.github.com/users/hcl14","html_url":"https://github.com/hcl14","followers_url":"https://api.github.com/users/hcl14/followers","following_url":"https://api.github.com/users/hcl14/following{/other_user}","gists_url":"https://api.github.com/users/hcl14/gists{/gist_id}","starred_url":"https://api.github.com/users/hcl14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hcl14/subscriptions","organizations_url":"https://api.github.com/users/hcl14/orgs","repos_url":"https://api.github.com/users/hcl14/repos","events_url":"https://api.github.com/users/hcl14/events{/privacy}","received_events_url":"https://api.github.com/users/hcl14/received_events","type":"User","site_admin":false},"created_at":"2018-10-16T08:50:46Z","updated_at":"2018-10-16T08:50:46Z","author_association":"NONE","body":"Hi @tabergma , I still don't see any new release neither here on github (latest is 2.0), nor in pip repository. Am I looking in the wrong places or it's not out yet?"}}
{"actor":{"display_login":"hcl14"}}