Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib2.URLError: <urlopen error [Errno 111] Connection refused> #478

Open
JadBatmobile opened this issue Feb 4, 2019 · 1 comment
Open

Comments

@JadBatmobile
Copy link

JadBatmobile commented Feb 4, 2019

After building from source in a virutal environment i get the following error when running the following example code:

# Sample 20 points
for i in range(20):
    # Use MOE to determine what is the point with highest Expected Improvement to use next
    next_point_to_sample = gp_next_points(exp)[0]  # By default we only ask for one point
    # Sample the point from our objective function, we can replace this with any function
    value_of_next_point = function_to_minimize(next_point_to_sample)

    print "Sampled f({0:s}) = {1:.18E}".format(str(next_point_to_sample), value_of_next_point)

    # Add the information about the point to the experiment historical data to inform the GP
    exp.historical_data.append_sample_points([SamplePoint(next_point_to_sample, value_of_next_point, 0.01)])  # We can add some noise

ERROR:
File "sd.py", line 24, in
next_point_to_sample = gp_next_points(exp)[0] # By default we only ask for one point
File "/home/hallab/moe_e/MOE/moe/easy_interface/simple_endpoint.py", line 54, in gp_next_points
json_response = call_endpoint_with_payload(rest_host, rest_port, endpoint, json_payload, testapp)
File "/home/hallab/moe_e/MOE/moe/easy_interface/simple_endpoint.py", line 24, in call_endpoint_with_payload
with contextlib.closing(urllib2.urlopen(request)) as f:
File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 429, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 447, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1228, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1198, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>

@JadBatmobile
Copy link
Author

I dont understand why it is trying to connect to anything since i built it from source... im not running through docker..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant