ImportError: cannot import name 'TFDistilBertModel'
Author: JKP0
Pull request: no

```
import tensorflow as tf
from transformers import DistilBertTokenizer, TFDistilBertModel

tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased')
model = TFDistilBertModel.from_pretrained('distilbert-base-uncased')
input_ids = tf.constant(tokenizer.encode("Hello, my dog is cute"))[None, :]  # Batch size 1
outputs = model(input_ids)
last_hidden_states = outputs[0]  # The last hidden-state is the first element of the output tuple
```

###################
these line of codes gives the error 

ImportError: cannot import name 'TFDistilBertModel'


############

![Screenshot (274)](https://user-images.githubusercontent.com/48640299/73121265-6e87d600-3f9e-11ea-8f44-ec8619b42835.png)
![Screenshot (275)](https://user-images.githubusercontent.com/48640299/73121268-78113e00-3f9e-11ea-9ef2-e77a26170178.png)





Comments:
Does the following import work?
`from transformers.modeling_tf_distilbert import TFDistilBertModel`
and what is the output of:
```
from transformers.file_utils import is_tf_available
is_tf_available()
```

Thank you for response. Thanks! 

> Does the following import work?
> `from transformers.modeling_tf_distilbert import TFDistilBertModel`

> This import works but gives the error.
  TypeError: Expected int32, got 0.0 of type 'float' instead.

> TypeError                                 Traceback (most recent call last)
<ipython-input-6-e6dacece142c> in <module>()
      3 
      4 tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased')
----> 5 model = TFDistilBertModel.from_pretrained('distilbert-base-uncased')
      6 input_ids = tf.constant(tokenizer.encode("Hello, my dog is cute"))[None, :]  # Batch size 1
      7 outputs = model(input_ids)

2 frames
/usr/local/lib/python3.6/dist-packages/transformers/modeling_tf_utils.py in from_pretrained(cls, pretrained_model_name_or_path, *model_args, **kwargs)
    309             return load_pytorch_checkpoint_in_tf2_model(model, resolved_archive_file, allow_missing_keys=True)
    310 
--> 311         ret = model(model.dummy_inputs, training=False)  # build the network with dummy inputs
    312 
    313         assert os.path.isfile(resolved_archive_file), "Error retrieving file {}".format(resolved_archive_file)

/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/engine/base_layer.py in __call__(self, inputs, *args, **kwargs)
    852                     outputs = base_layer_utils.mark_as_return(outputs, acd)
    853                 else:
--> 854                   outputs = call_fn(cast_inputs, *args, **kwargs)
    855 
    856             except errors.OperatorNotAllowedInGraphError as e:

/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/autograph/impl/api.py in wrapper(*args, **kwargs)
    235       except Exception as e:  # pylint:disable=broad-except
    236         if hasattr(e, 'ag_error_metadata'):
--> 237           raise e.ag_error_metadata.to_exception(e)
    238         else:
    239           raise

TypeError: in converted code:
    relative to /usr/local/lib/python3.6/dist-packages:

    transformers/modeling_tf_distilbert.py:569 call  *
        outputs = self.distilbert(inputs, **kwargs)
    tensorflow_core/python/keras/engine/base_layer.py:854 __call__
        outputs = call_fn(cast_inputs, *args, **kwargs)
    transformers/modeling_tf_distilbert.py:455 call  *
        embedding_output = self.embeddings(input_ids, inputs_embeds=inputs_embeds)   # (bs, seq_length, dim)
    tensorflow_core/python/keras/engine/base_layer.py:824 __call__
        self._maybe_build(inputs)
    tensorflow_core/python/keras/engine/base_layer.py:2146 _maybe_build
        self.build(input_shapes)
    transformers/modeling_tf_distilbert.py:97 build
        initializer=get_initializer(self.initializer_range))
    tensorflow_core/python/keras/engine/base_layer.py:529 add_weight
        aggregation=aggregation)
    tensorflow_core/python/training/tracking/base.py:712 _add_variable_with_custom_getter
        **kwargs_for_getter)
    tensorflow_core/python/keras/engine/base_layer_utils.py:139 make_variable
        shape=variable_shape if variable_shape else None)
    tensorflow_core/python/ops/variables.py:258 __call__
        return cls._variable_v1_call(*args, **kwargs)
    tensorflow_core/python/ops/variables.py:219 _variable_v1_call
        shape=shape)
    tensorflow_core/python/ops/variables.py:197 <lambda>
        previous_getter = lambda **kwargs: default_variable_creator(None, **kwargs)
    tensorflow_core/python/ops/variable_scope.py:2503 default_variable_creator
        shape=shape)
    tensorflow_core/python/ops/variables.py:262 __call__
        return super(VariableMetaclass, cls).__call__(*args, **kwargs)
    tensorflow_core/python/ops/resource_variable_ops.py:1406 __init__
        distribute_strategy=distribute_strategy)
    tensorflow_core/python/ops/resource_variable_ops.py:1537 _init_from_args
        initial_value() if init_from_fn else initial_value,
    tensorflow_core/python/keras/engine/base_layer_utils.py:119 <lambda>
        init_val = lambda: initializer(shape, dtype=dtype)
    tensorflow_core/python/ops/init_ops.py:369 __call__
        shape, self.mean, self.stddev, dtype, seed=self.seed)
    tensorflow_core/python/ops/random_ops.py:171 truncated_normal
        mean_tensor = ops.convert_to_tensor(mean, dtype=dtype, name="mean")
    tensorflow_core/python/framework/ops.py:1184 convert_to_tensor
        return convert_to_tensor_v2(value, dtype, preferred_dtype, name)
    tensorflow_core/python/framework/ops.py:1242 convert_to_tensor_v2
        as_ref=False)
    tensorflow_core/python/framework/ops.py:1297 internal_convert_to_tensor
        ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
    tensorflow_core/python/framework/tensor_conversion_registry.py:52 _default_conversion_function
        return constant_op.constant(value, dtype, name=name)
    tensorflow_core/python/framework/constant_op.py:227 constant
        allow_broadcast=True)
    tensorflow_core/python/framework/constant_op.py:265 _constant_impl
        allow_broadcast=allow_broadcast))
    tensorflow_core/python/framework/tensor_util.py:449 make_tensor_proto
        _AssertCompatible(values, dtype)
    tensorflow_core/python/framework/tensor_util.py:331 _AssertCompatible
        (dtype.name, repr(mismatch), type(mismatch).__name__))

    TypeError: Expected int32, got 0.0 of type 'float' instead.

 
> and what is the output of:
> 
> ```
> from transformers.file_utils import is_tf_available
> is_tf_available()
> ```
> Output of this line is 
`False` 


![Screenshot (281)](https://user-images.githubusercontent.com/48640299/73129274-9fe7bc80-4005-11ea-8fa2-1be001c32872.png)


In my case it got resolved by (but have reached to another issue)
> conda create -n bcm python==3.6.8 anaconda 
> conda activate bcm
> conda install tensorflow-gpu
> pip install transformers 

> Does the following import work?
> `from transformers.modeling_tf_distilbert import TFDistilBertModel`
> and what is the output of:
> 
> ```
> from transformers.file_utils import is_tf_available
> is_tf_available()
> ```

I have the same error with TFBertModel, and when I run this, I get "False"
Any suggestions? @cronoik 

@sbecon 
That means that you haven't installed tensorflow 2.0 (or you have installed it in a different virtual environment). Please follow the [instructions](https://www.tensorflow.org/install/pip#tensorflow-2.0-rc-is-available) and install it. It should work afterwards.