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

[BUG] OS error when extracing image dataset #5473

Open
1 of 3 tasks
TheMatrixNeo opened this issue Feb 5, 2025 · 2 comments
Open
1 of 3 tasks

[BUG] OS error when extracing image dataset #5473

TheMatrixNeo opened this issue Feb 5, 2025 · 2 comments
Labels
bug Bug fixes

Comments

@TheMatrixNeo
Copy link

Instructions

Describe the problem

when using fiftyone to download coco dataset on my mac. After runing on jupyter notebook with python3.12 ,there were errors reported which I did not find same issues online

Code to reproduce issue

import PIL
from PIL import Image
import torch
import torchvision
import cv2
import os
import pandas as pd
import numpy as np
import fiftyone
dataset =fiftyone.zoo.load_zoo_dataset('coco-2017',split='validation')

# commands and/or screenshots here

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 22.04):Macos M2 max 15.1.1
  • Python version (python --version):3.12
  • FiftyOne version (fiftyone --version):1.3.0
  • FiftyOne installed from (pip or source):pip

Other info/logs

Traceback (most recent call last):
File "/Users/xxx/miniforge3/envs/demo312/lib/python3.12/site-packages/fiftyone/service/main.py", line 263, in
child = psutil.Popen(
^^^^^^^^^^^^^
File "/Users/xxx/miniforge3/envs/demo312/lib/python3.12/site-packages/psutil/init.py", line 1408, in init
self.__subproc = subprocess.Popen(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/xxx/miniforge3/envs/demo312/lib/python3.12/subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Users/xxx/miniforge3/envs/demo312/lib/python3.12/subprocess.py", line 1950, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 86] Bad CPU type in executable: '/Users/xxx/miniforge3/envs/demo312/lib/python3.12/site-packages/fiftyone/db/bin/mongod'

ServiceListenTimeout Traceback (most recent call last)
Cell In[9], line 1
----> 1 dataset =fiftyone.zoo.load_zoo_dataset('coco-2017',split='validation')

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/fiftyone/zoo/datasets/init.py:399, in load_zoo_dataset(name_or_url, split, splits, label_field, dataset_name, download_if_necessary, drop_existing_dataset, persistent, overwrite, cleanup, progress, **kwargs)
396 if "max_samples" in importer_kwargs:
397 dataset_name += "-%s" % importer_kwargs["max_samples"]
--> 399 if fo.dataset_exists(dataset_name):
400 if not drop_existing_dataset:
401 logger.info(
402 "Loading existing dataset '%s'. To reload from disk, either "
403 "delete the existing dataset or provide a custom "
404 "dataset_name to use",
405 dataset_name,
406 )

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/fiftyone/core/dataset.py:103, in dataset_exists(name)
94 def dataset_exists(name):
95 """Checks if the dataset exists.
96
97 Args:
(...)
101 True/False
102 """
--> 103 conn = foo.get_db_conn()
104 return bool(list(conn.datasets.find({"name": name}, {"_id": 1}).limit(1)))

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/fiftyone/core/odm/database.py:394, in get_db_conn()
388 def get_db_conn():
389 """Returns a connection to the database.
390
391 Returns:
392 a pymongo.database.Database
393 """
--> 394 _connect()
395 db = _client[fo.config.database_name]
396 return _apply_options(db)

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/fiftyone/core/odm/database.py:233, in _connect()
230 if _client is None:
231 global _connection_kwargs
--> 233 establish_db_conn(fo.config)

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/fiftyone/core/odm/database.py:195, in establish_db_conn(config)
193 try:
194 _db_service = fos.DatabaseService()
--> 195 port = _db_service.port
196 _connection_kwargs["port"] = port
197 os.environ["FIFTYONE_PRIVATE_DATABASE_PORT"] = str(port)

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/fiftyone/core/service.py:277, in DatabaseService.port(self)
275 @Property
276 def port(self):
--> 277 return self._wait_for_child_port()

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/fiftyone/core/service.py:171, in Service._wait_for_child_port(self, port, timeout)
167 pass
169 raise ServiceListenTimeout(etau.get_class_name(self), port)
--> 171 return find_port()

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/retrying.py:56, in retry..wrap..wrapped_f(*args, **kw)
54 @six.wraps(f)
55 def wrapped_f(*args, **kw):
---> 56 return Retrying(*dargs, **dkw).call(f, *args, **kw)

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/retrying.py:266, in Retrying.call(self, fn, *args, **kwargs)
263 if self.stop(attempt_number, delay_since_first_attempt_ms):
264 if not self._wrap_exception and attempt.has_exception:
265 # get() on an attempt with an exception should cause it to be raised, but raise just in case
--> 266 raise attempt.get()
267 else:
268 raise RetryError(attempt)

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/retrying.py:301, in Attempt.get(self, wrap_exception)
299 raise RetryError(self)
300 else:
--> 301 six.reraise(self.value[0], self.value[1], self.value[2])
302 else:
303 return self.value

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/six.py:724, in reraise(tp, value, tb)
722 if value.traceback is not tb:
723 raise value.with_traceback(tb)
--> 724 raise value
725 finally:
726 value = None

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/retrying.py:251, in Retrying.call(self, fn, *args, **kwargs)
248 self._before_attempts(attempt_number)
250 try:
--> 251 attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
252 except:
253 tb = sys.exc_info()

File ~/miniforge3/envs/demo312/lib/python3.12/site-packages/fiftyone/core/service.py:169, in Service._wait_for_child_port..find_port()
166 except psutil.Error:
167 pass
--> 169 raise ServiceListenTimeout(etau.get_class_name(self), port)

ServiceListenTimeout: fiftyone.core.service.DatabaseService failed to bind to port

Willingness to contribute

The FiftyOne Community encourages bug fix contributions. Would you or another
member of your organization be willing to contribute a fix for this bug to the
FiftyOne codebase?

  • Yes. I can contribute a fix for this bug independently
  • Yes. I would be willing to contribute a fix for this bug with guidance
    from the FiftyOne community
  • No. I cannot contribute a bug fix at this time
@TheMatrixNeo TheMatrixNeo added the bug Bug fixes label Feb 5, 2025
@benjaminpkane
Copy link
Contributor

Hi @TheMatrixNeo. Can you share your ~/.fiftyone/var/lib/mongo/log/mongo.log file? There should be a reason for the failure in there

@benjaminpkane
Copy link
Contributor

This looks like an Apple Silicon issue. You may need to install Rosetta

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

No branches or pull requests

2 participants