colcarroll / imcmc Goto Github PK
View Code? Open in Web Editor NEWImage Markov Chain Monte Carlo
License: MIT License
Image Markov Chain Monte Carlo
License: MIT License
I stumbled upon a multiprocessing error when trying to run the example code and one of the warnings mentioned that could be because there was no if preventing the entry point code to run again and again after a fork.
Wrapping the example code around an if __name__ == '__main__'
did the trick.
By the way, this is a very nice project. Thanks for sharing
Code:
import imcmc
image = imcmc.load_image('my_logo_blk.png', 'L')
trace = imcmc.sample_grayscale(image)
Output:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-16-1ad864fbcc0c> in <module>()
4 image = imcmc.load_image('novartis_logo_pos_blk.png', 'L')
5
----> 6 trace = imcmc.sample_grayscale(image)
~/github/software/imcmc/imcmc/imcmc.py in sample_grayscale(image, samples, tune, nchains, threshold)
114 tune=tune,
115 chains=nchains, step=pm.Metropolis(),
--> 116 start=[{'image': x} for x in start],
117 )
118 return trace
~/anaconda/envs/imcmc/lib/python3.6/site-packages/pymc3/sampling.py in sample(draws, step, init, n_init, start, trace, chain, njobs, tune, nuts_kwargs, step_kwargs, progressbar, model, random_seed, live_plot, discard_tuned_samples, live_plot_kwargs, **kwargs)
283 discard = tune if discard_tuned_samples else 0
284
--> 285 return sample_func(**sample_args)[discard:]
286
287
~/anaconda/envs/imcmc/lib/python3.6/site-packages/pymc3/sampling.py in _sample(draws, step, start, trace, chain, tune, progressbar, model, random_seed, live_plot, live_plot_kwargs, **kwargs)
330 try:
331 strace = None
--> 332 for it, strace in enumerate(sampling):
333 if live_plot:
334 if live_plot_kwargs is None:
~/anaconda/envs/imcmc/lib/python3.6/site-packages/tqdm/_tqdm.py in __iter__(self)
951 """, fp_write=getattr(self.fp, 'write', sys.stderr.write))
952
--> 953 for obj in iterable:
954 yield obj
955 # Update and possibly print the progressbar.
~/anaconda/envs/imcmc/lib/python3.6/site-packages/pymc3/sampling.py in _iter_sample(draws, step, start, trace, chain, tune, model, random_seed)
409 update_start_vals(start, strace.point(-1), model)
410 else:
--> 411 update_start_vals(start, model.test_point, model)
412
413 try:
~/anaconda/envs/imcmc/lib/python3.6/site-packages/pymc3/util.py in update_start_vals(a, b, model)
143 a[name], point=b).eval()
144
--> 145 a.update({k: v for k, v in b.items() if k not in a})
146
147
AttributeError: 'list' object has no attribute 'update'
I was trying to use your 'imcmc' package but am running into few challenges. I am not able to run the test files as well.
Error: AttributeError: module 'theano' has no attribute 'Op'
I was hoping if you could help me out with the same.
The last days I have been playing with pymc3, and found this error:
pymc-devs/pymc#3068
I had to install the latest version available in their repo to solve the issue (it's 3.4.1 available in master).
When I installed your package, pip installed pymc3 3.3 as required in requirements.txt. So my pymc3 was downgraded. When I run your getting started example, I got the error above again.
I have upgraded pymc3 again to the bleeding edge version, and I could run your example.
My suggestion is that you update the requirements.txt.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.