SVI notebook errors in Python 3.5
See original GitHub issueHi! I’m trying to run the SVI notebook (http://nbviewer.jupyter.org/github/SheffieldML/notebook/blob/master/GPy/SVI.ipynb) on Python 3.5 using the devel branch of GPy. I get the following error at In [4]
:
Z = np.random.rand(20,1)
batchsize = 10
m = GPy.core.SVGP(X, Y, Z, GPy.kern.RBF(1) + GPy.kern.White(1), GPy.likelihoods.Gaussian(), batchsize=batchsize)
m.kern.white.variance = 1e-5
m.kern.white.fix()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-4-382f732b700d> in <module>()
2
3 batchsize = 10
----> 4 m = GPy.core.SVGP(X, Y, Z, GPy.kern.RBF(1) + GPy.kern.White(1), GPy.likelihoods.Gaussian(), batchsize=batchsize)
5 m.kern.white.variance = 1e-5
6 m.kern.white.fix()
/.../lib/python3.5/site-packages/paramz/parameterized.py in __call__(self, *args, **kw)
46 self._in_init_ = True
47 #import ipdb;ipdb.set_trace()
---> 48 self = super(ParametersChangedMeta, self).__call__(*args, **kw)
49 #logger.debug("finished init")
50 self._in_init_ = False
/.../lib/python3.5/site-packages/GPy/core/svgp.py in __init__(self, X, Y, Z, kernel, likelihood, mean_function, name, Y_metadata, batchsize, num_latent_functions)
34 #Make a climin slicer to make drawing minibatches much quicker
35 self.slicer = climin.util.draw_mini_slices(self.X_all.shape[0], self.batchsize)
---> 36 X_batch, Y_batch = self.new_batch()
37
38 #create the SVI inference method
/.../lib/python3.5/site-packages/GPy/core/svgp.py in new_batch(self)
90 Return a new batch of X and Y by taking a chunk of data from the complete X and Y
91 """
---> 92 i = next(self.slicer)
93 return self.X_all[i], self.Y_all[i]
94
/.../lib/python3.5/site-packages/climin/util.py in draw_mini_slices(n_samples, batch_size, with_replacement)
90 else:
91 while True:
---> 92 random.shuffle(idxs)
93 for i in idxs:
94 yield slices[i]
/usr/lib/python3.5/random.py in shuffle(self, x, random)
270 # pick an element in x[:i+1] with which to exchange x[i]
271 j = randbelow(i+1)
--> 272 x[i], x[j] = x[j], x[i]
273 else:
274 _int = int
TypeError: 'range' object does not support item assignment
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Exception: The non-notebook version of vpython requires ...
Once i tried importing the library, this error came up: Exception: The non-notebook version of vpython requires Python 3.5 or later. vpython ...
Read more >8. Errors and Exceptions — Python 3.11.1 documentation
Syntax errors, also known as parsing errors, are perhaps the most common kind of complaint you get while you are still learning Python:....
Read more >Running Jupyter notebook --- Existing python 3.5 interferes
I'm trying to run a MAF tutorial in a jupyter notebook and I am getting this error when I try to start jupyter:...
Read more >Cumulus Linux | Cumulus Linux 4.3 - NVIDIA Documentation Center
If your host (laptop or server) is IPv6-enabled, make sure it is running a web ... user@host:~$ python3 -c "import crypt; print(crypt.crypt('MyP4$$word' ...
Read more >computation of circular area and spherical volume invariants via ...
that u is smooth but continue to impose the boundary condition in (3.5). ... in that it leads to a simple form for...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This seems to work/not work depending on the version of climin. The PyPI version of climin is different to the Github version. Installing via
pip install climin
will installclimin 0.1a1
from PyPI, but following the instructions on the readthedocs, as follows, will installclimin pre-0.1
, which should work with Python 3.5+:i have the same problem with google colab python version3.6 and @wilocw solution work well.