title: "ValueError: Not a location id (Invalid object id)" while creating HDF5 datasets
body: <p>I have an numpy array(arr) of size (3997,29). I am using this array to create a dataset. This array has both integer and float variables. So dtype is reference. But when I execute it I get the below error.</p>
  <blockquote>
  <p>&quot;ValueError: Not a location id (Invalid object id)&quot;</p>
  </blockquote>
  <pre><code>with h5py.File(&quot;test1.h5&quot;, 'w') as f:
       grp = f.create_group('Nodes')
  
  with h5py.File(&quot;test1.h5&quot;, 'r+') as f:
       grp = f.require_group('Nodes')
  
  ref_dtype = h5py.special_dtype(ref=h5py.Reference)
  
  arrshape = np.shape(arr)
    
  dset = grp.create_dataset('Init' ,arrshape, dtype = ref_dtype , data= arr)
  </code></pre>
  <p>The error occurs in the last line. Below are the traceback messages</p>
  <pre><code> dset = f.create_dataset('Init' ,arrshape, dtype = ref_dtype , data= arr)
  
    File &quot;C:\Users\rupesh.n\AppData\Local\Continuum\anaconda3\lib\site-packages\h5py\_hl\group.py&quot;, line 108, in create_dataset
      dsid = dataset.make_new_dset(self, shape, dtype, data, **kwds)
  
    File &quot;C:\Users\rupesh.n\AppData\Local\Continuum\anaconda3\lib\site-packages\h5py\_hl\dataset.py&quot;, line 137, in make_new_dset
      dset_id = h5d.create(parent.id, None, tid, sid, dcpl=dcpl)
  
    File &quot;h5py\_objects.pyx&quot;, line 54, in h5py._objects.with_phil.wrapper
  
    File &quot;h5py\_objects.pyx&quot;, line 55, in h5py._objects.with_phil.wrapper
  
    File &quot;h5py\h5d.pyx&quot;, line 79, in h5py.h5d.create
  
  ValueError: Not a location id (Invalid object id)
  </code></pre>