Getting Error in the model plot of Density model

I tried to do 3D susceptibility and Density models using SimPEG Magnetic and Gravity Inversion codes.

I am getting the predicted anomaly and normalized misfit plot also. However, when i tried to plot the 3D models, i am getting error.
Dear SimPEG users, please help me.


Exception Traceback (most recent call last)
/tmp/ipykernel_13173/2025731010.py in
52 )
53 ax = plt.subplot(221)
—> 54 dat = mesh.plotSlice(
55 recovered_model,
56 ax=ax,

~/.local/lib/python3.8/site-packages/discretize/utils/code_utils.py in new_method(self, *args, **kwargs)
157 DeprecationWarning,
158 )
→ 159 return getattr(self, new_name)(*args, **kwargs)
160
161 doc = f"{old_name} has been deprecated. See {new_name} for documentation"

~/.local/lib/python3.8/site-packages/discretize/mixins/mpl_mod.py in plot_slice(self, v, v_type, normal, ind, slice_loc, grid, view, ax, clim, show_it, pcolor_opts, stream_opts, grid_opts, range_x, range_y, sample_grid, stream_threshold, stream_thickness, **kwargs)
634 pcolor_opts[“vmax”] = clim[1]
635
→ 636 out = plotter(
637 v,
638 v_type=v_type,

~/.local/lib/python3.8/site-packages/discretize/mixins/mpl_mod.py in __plot_slice_tensor(self, v, v_type, normal, ind, grid, view, ax, pcolor_opts, stream_opts, grid_opts, range_x, range_y, sample_grid, stream_threshold, stream_thickness, **kwargs)
1348 x2d.append(self.origin[2])
1349 tM = self.class(h=h2d, origin=x2d) #: Temp Mesh
→ 1350 v2d = doSlice(v)
1351
1352 out = tM.__plot_image_tensor2D(

~/.local/lib/python3.8/site-packages/discretize/mixins/mpl_mod.py in doSlice(v)
1309 def doSlice(v):
1310 if v_type == “CC”:
→ 1311 return getIndSlice(self.reshape(v, “CC”, “CC”, “M”))
1312 elif v_type == “CCv”:
1313 if view != “vec”:

~/.local/lib/python3.8/site-packages/discretize/base/base_mesh.py in reshape(self, x, x_type, out_type, format, **kwargs)
1141 return out
1142 else:
→ 1143 return switchKernal(x)
1144
1145 # DEPRECATED

~/.local/lib/python3.8/site-packages/discretize/base/base_mesh.py in switchKernal(xx)
1078 nn = self.shape_cells if x_type == “cell_centers” else self.shape_nodes
1079 if xx.size != np.prod(nn):
→ 1080 raise Exception(“Number of elements must not change.”)
1081 return outKernal(xx, nn)
1082 elif x_type in [“faces”, “edges”]:

Exception: Number of elements must not change.