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

ValueError: Number of processes must be at least 1 #17

Open
WATCH0620 opened this issue May 10, 2024 · 2 comments
Open

ValueError: Number of processes must be at least 1 #17

WATCH0620 opened this issue May 10, 2024 · 2 comments

Comments

@WATCH0620
Copy link

WATCH0620 commented May 10, 2024

When I attempted to use RoseTTAFold, I encountered the following error at the end.

ValueError                                Traceback (most recent call last)
[<ipython-input-6-db7245cb6df4>](https://localhost:8080/#) in <cell line: 1>()
----> 1 mn.build_model(user_json='/content/drive/MyDrive/synthoseis-master/config/example.json', run_id=1,test_mode=50)

5 frames
[/content/drive/MyDrive/synthoseis-master/main.py](https://localhost:8080/#) in build_model(user_json, run_id, test_mode, rpm_factors)
     53     seismic = SeismicVolume(p, f, closures)
     54     seismic.build_elastic_properties("inv_vel")
---> 55     seismic.build_seismic_volumes()
     56 
     57     closures.write_closure_info_to_log(seismic.rfc_raw[1:4, ...])

[/content/drive/MyDrive/synthoseis-master/datagenerator/Seismic.py](https://localhost:8080/#) in build_seismic_volumes(self)
    249         if hasattr(self.cfg, "wavelets"):
    250             self.bandlimit_volumes_wavelets(n_wavelets=1)
--> 251         normalised_cumsum = self.postprocess_rfc_cubes(
    252             self.rfc_noise_added[:], "", stack=True
    253         )

[/content/drive/MyDrive/synthoseis-master/datagenerator/Seismic.py](https://localhost:8080/#) in postprocess_rfc_cubes(self, rfc_data, filename_suffix, bb, stack)
    164             bandlimited = self.apply_bandlimits(rfc_data, (4.0, 90.0))
    165         else:
--> 166             bandlimited = self.apply_bandlimits(rfc_data)
    167         if self.cfg.lateral_filter_size > 1:
    168             bandlimited = self.apply_lateral_filter(bandlimited)

[/content/drive/MyDrive/synthoseis-master/datagenerator/Seismic.py](https://localhost:8080/#) in apply_bandlimits(self, data, frequencies)
    509         if self.cfg.multiprocess_bp:
    510             # Much faster to use multiprocessing and apply band-limitation to entire cube at once
--> 511             with Pool(processes=min(num, os.cpu_count() - 2)) as p:
    512                 iterator = zip(
    513                     [data[x, ...] for x in range(num)],

[/usr/lib/python3.10/multiprocessing/context.py](https://localhost:8080/#) in Pool(self, processes, initializer, initargs, maxtasksperchild)
    117         '''Returns a process pool object'''
    118         from .pool import Pool
--> 119         return Pool(processes, initializer, initargs, maxtasksperchild,
    120                     context=self.get_context())
    121 

[/usr/lib/python3.10/multiprocessing/pool.py](https://localhost:8080/#) in __init__(self, processes, initializer, initargs, maxtasksperchild, context)
    203             processes = os.cpu_count() or 1
    204         if processes < 1:
--> 205             raise ValueError("Number of processes must be at least 1")
    206         if maxtasksperchild is not None:
    207             if not isinstance(maxtasksperchild, int) or maxtasksperchild <= 0:

ValueError: Number of processes must be at least 1
@tpmerrifield
Copy link

Hi, it looks like os.cpu_count() is returning a processes value that is < 1, which is a bit strange. What machine are you using?
You should be able to turn off multiprocessing by setting the "multiprocess_bp" to false in the config file.

@WATCH0620
Copy link
Author

Hi, it looks like os.cpu_count() is returning a processes value that is < 1, which is a bit strange. What machine are you using? You should be able to turn off multiprocessing by setting the "multiprocess_bp" to false in the config file.

This problem has been solved, thank you. The machine OS i use is Windows7.
I have other problem, how can i synthesize a data without noise added?

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

2 participants